It seems there's a slight annoyance that I can't seem to work around. Hopefully I've missed something that the NT guys can let me know about.
The problem I have is I want to add Tick bid and ask data (or 1 minute bid/ask data) to my strategy in the init. function so that I get accurate backtesting results (ie: my profit and stop loss targets are hit correctly).
From what I understand, you need to specify the MarketDataType. bid/ask in the add call to specify whether it's bid or ask data.
The issue then, is that you need to specify the instrument name, as there doesn't seem to be an "add" prototype that includes the MarketDataType input parameter without having to specify the instrument name.
The issue is that when I want to run say a basket of currencies to test, you can't do it (unless you add every currency/instrument to the init function, thus loading tens of gigs of data unnecessarily)...
This seems to be an oversight to me as you can dynamically add dataseries of different timeperiods of the input instrument being tested, ie: Add(PeriodType.minute, 240); etc
but to add the bid/ask data you have to do something like the following:
Add("$AUDUSD", PeriodType.Minute, 1, MarketDataType.Ask); // add one minute data series
Add("$AUDUSD", PeriodType.Minute, 1, MarketDataType.Bid); // add one minute data series
I also tried doing the following:
Add(Instrument.MasterInstrument.Name.ToString(), PeriodType.Minute, 1, MarketDataType.Ask); // add one minute data series
Add(Instrument.MasterInstrument.Name.ToString(), PeriodType.Minute, 1, MarketDataType.Bid); // add one minute data series
BUT this does NOT work as there is an error as i don't think this variable is defined until after the init function, so the strat does not run with the above statement
----
Overall please tell me how i add bod and ask data to the strategy so i can run a basket backtest.
thanks
Daniel
Comment