Announcement

Collapse
No announcement yet.

Millionaire Backtesting - Broke Realtime

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Millionaire Backtesting - Broke Realtime

    I have created an efs system that works great whilst backtesting.

    When I run the efs live in realtime, I get realtime buy and sell signals (everything seems ok).

    (but...) When I refresh the chart, the buy and sell signals move to a more favourable position, therefore showing me backtesting reports that would never materialise in realtime. Some of the trades triggered in realtime even disappear!

    Please could you look at the attached file and correct my code.

    I am buying & selling off a 1 min chart.

    I use 1, 3, 11, 17 & 57 Stochastic Intervals in my strategy.

    I use setComputeOnClose(true);

    ps: Please don't send me to another thread because I've spent hours doing that already. I need to tighten up my backtesting to get closer to realtime results.

    Please help, I've spent months on backtesting and get the same situation every time I go live!

    Regards
    Darren
    Attached Files

  • #2
    Darren
    The different results that you are seeing when running the efs in real time or on historical data are due to the the fact that the logic you implemented is "forward looking" when the script is using historical data. In other words it "knows" at the beginning of an interval what the value of the study will be at the end of that same interval.
    This is described in depth in this post which I would suggest you read.
    To resolve these differences you will need to modify your logic so that it will generate the signals only when the bars of each external interval are completed. While it is true that you do have setComputeOnClose() that applies only to the main interval (ie the one being used in the chart) and not to the external intervals.
    Alex

    Comment

    Working...
    X