have backtested a strategy based of the 1 minute chart using
Price Only Modelling.
have then backtested the strategy using every tick mode.
get the every tick mode to match the open price only modelling I added the following code(found in another thread):
static datetime prevFastTime;
time = iTime(Symbol(), PERIOD_M1,0);
if(time > prevFastTime)
prevFastTime = time;
//rest of code goes here//
code correctly looks for a new bar and serves that purpose fine. However the entries are off by a few minutes and there are more entries than in
the Open Price Only Modelling. Surely as both are waiting for a new bar they should match?
is this? How do I match every tick to open price only?
for any help!
I have realised the above is a bit wordy so.....TLDR version:
What code can you add to an EA script that controls the bar opening so that it performs live the same as the Open
Price Only Modelling
Thank you so much for your reply.
The code you linked performed the same irregularities i.e. - more trades and slightly different timing to Open Price Only Modelling.
Do you know why with this code, Every Tick would give different back testing results to Open Price Only when the logic is the same. i.e.
Even though the modelling is every tick , both back testing models should only execute on the start of a new bar and so should give the
Sorry if i'm missing something!
Are you running on the M1 chart? What part of "Your code only does that for the M1 chart" was unclear?
Yes i am running on the M1 chart. I wrote "I
a strategy based of the 1 minute chart" on the second line in my first post. Maybe I should have been more clear?
What was unclear to me was how the results still differ between the two backtesting models when both (because of the bar control code) execute on
the same logic and at the same time.
Does that make sense?