Backtesting questions

Questions about MultiCharts and user contributed studies.
bluefightingcat
Posts: 38
Joined: 31 Oct 2015
Has thanked: 1 time
Been thanked: 2 times

Backtesting questions

Postby bluefightingcat » 13 Nov 2015

I am trying to backtest my strategy in Portfolio trader. Essentially it contains entry and exit rules based on 1 day data. However my understanding is that you cannot send a buy or sell signal during the same bar. I would have to wait for the next bar and using 1 day data that would mean waiting until tomorrow. What I want to happen is that the "minute" my entry rule is fulfilled the instrument would be bought.

1. If I have understood I would need to use the bar magnifier to achieve this?

2. What is the most accurate way to backtest? Using bar magnifier and IOG?

3. If I use bar magnifier would I need to build the one day data using 1 minute data?

tony
Posts: 420
Joined: 14 Jun 2013
Has thanked: 30 times
Been thanked: 81 times
Contact:

Re: Backtesting questions

Postby tony » 13 Nov 2015

If you want a trade to be generated "intrabar" then you need to use IOG mode which will generate an order on the "next bar" after conditions are met and in IOG next bar is next tick. Using bar magnifier simply helps determine how a bar was formed and will give you more accurate back tests, but only if you are trading "intrabar."

Edit - after re-reading your post, I forgot to ask if you bar duration on your charts is 1 minute? If so, if you don't use IOG mode then "next bar" would be the open of the next 1 minute candle, which depending on the speed of the instrument traded may be fine.

bluefightingcat
Posts: 38
Joined: 31 Oct 2015
Has thanked: 1 time
Been thanked: 2 times

Re: Backtesting questions

Postby bluefightingcat » 13 Nov 2015

Thanks for making things clearer. My data1 is currently 1 day resolution. Would I need to add another dataset e.g. 1 minute resolution to be able to IOG? Would it help if I build the 1 day resolution from minutes?

How exactly do I turn on IOG? I've add the command to my code but when I got portfolio trader the IOG option for my strategy is greyed out.

tony
Posts: 420
Joined: 14 Jun 2013
Has thanked: 30 times
Been thanked: 81 times
Contact:

Re: Backtesting questions

Postby tony » 13 Nov 2015

Thanks for making things clearer. My data1 is currently 1 day resolution. Would I need to add another dataset e.g. 1 minute resolution to be able to IOG? Would it help if I build the 1 day resolution from minutes?

No you do not. And I would advise against doing that from a backtesting standpoint.

How exactly do I turn on IOG? I've add the command to my code but when I got portfolio trader the IOG option for my strategy is greyed out.
You added - [intrabarordergeneration = true ];

You also need to declare your variables as intrabarpersist var1 (0), for example

You should be able to click (actually should be clicked already) the enable IOG radio button in format - properties.

Before you try to figure out how to get IOG turned on, make sure it's truly what you want. Some people want to wait until the bar (in your case the day) is ended before determining if a position is valid or not.

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: Backtesting questions

Postby Henry MultiСharts » 20 Nov 2015

Hello bluefightingcat,

Portfolio Trader does not support IOG and BarMagnifier for trading signals.
IOG is supported for the money management signal only.
In order to have multiple signals same day you need to use an intra-day resolution as Data1.


Return to “MultiCharts”