Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

adding tick bid/ask data for accurate testing to basket testing in strategy analyzer

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

    adding tick bid/ask data for accurate testing to basket testing in strategy analyzer

    Hi,

    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

    #2
    Hello Daniel,
    Thanks for your note.

    If you try the below code then are you able to make it work

    Code:
    Add(Instrument.FullName, PeriodType.Minute, 1, MarketDataType.Ask);
    http://www.ninjatrader.com/support/h...t_fullname.htm
    JoydeepNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by mattdowns1234, Today, 06:57 PM
    0 responses
    10 views
    0 likes
    Last Post mattdowns1234  
    Started by dgee949, Today, 06:26 PM
    0 responses
    15 views
    0 likes
    Last Post dgee949
    by dgee949
     
    Started by dgee949, Today, 05:58 PM
    0 responses
    20 views
    0 likes
    Last Post dgee949
    by dgee949
     
    Started by thepcmd, Today, 05:14 PM
    0 responses
    29 views
    0 likes
    Last Post thepcmd
    by thepcmd
     
    Started by xmess777, Today, 04:58 PM
    0 responses
    21 views
    0 likes
    Last Post xmess777  
    Working...
    X