Understanding intrabar order backtesting

Questions about MultiCharts and user contributed studies.
User avatar
danilo
Posts: 170
Joined: 02 Jan 2007
Location: Italy
Has thanked: 4 times
Been thanked: 9 times

Understanding intrabar order backtesting

Postby danilo » 16 Feb 2008

Supposing to have set on the intrabar order Generation, I'm doing back testing on 5-min bar.

The current bar has the following values: O=8, L=5, H=15, C=12.

The strategy contains the following code:

if (close > =10) the buy this bar;

I would expect the order filled at 10, since when the condition is true, the close is almost equal to 10, instead of is filled at 12 ie the close value of bar. This behaviour could make sense if was not enabled the intrabar order generation, please could you explain the logic of intrabar order backtesting ?

Regards,

User avatar
Andrew Kirillov
Posts: 1589
Joined: 28 Jul 2005
Has thanked: 2 times
Been thanked: 31 times
Contact:

Postby Andrew Kirillov » 16 Feb 2008

Danilo,
Your understanding of IOG is correct and it should work in backtesting mode as you explained. However we haven't implemented it yet. IOB works properly in real-time, but doesn’t work properly on history.
We will fix it in the Beta 2 or hot fix builds of Beta 2.

User avatar
danilo
Posts: 170
Joined: 02 Jan 2007
Location: Italy
Has thanked: 4 times
Been thanked: 9 times

Postby danilo » 22 Apr 2008

Andrew,

I have verified that the IOG back-testing problem has not been fixed yet. Since I cannot test a strategy if the back-testing is not working, I'd like know when will be released a fix.

User avatar
danilo
Posts: 170
Joined: 02 Jan 2007
Location: Italy
Has thanked: 4 times
Been thanked: 9 times

Postby danilo » 09 Jun 2008

Andrew,

Even with last beta the bug has been fixed yet ! could you tell me when will be corrected ?

regards,
Danilo

User avatar
Marina Pashkova
Posts: 2758
Joined: 27 Jul 2007

Postby Marina Pashkova » 10 Jun 2008

Hi Danilo,

I discussed the issue you're reporting with Andrew Kirillov. He misunderstood your question and the situation that you're describing is not a bug, but a normal backtesting behavior in both MultiCharts and TS.

In your case, if you wanted an order to be generated at the price of 10, you should have written

------------------------
buy next bar at 10 stop;
------------------------
The code would have generated the required order even without the IOG mode enabled.


OR

with the IOG mode enabled, you could have written

-----------------------
buy next bar at market;
-----------------------

But given the prices you cited, this condition wouldn't have been met.


Note: Buy this bar; is generated on bar CLOSE (both in MC and TS)

Regards.


Return to “MultiCharts”