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);
    JoydeepNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by traderqz, Yesterday, 09:06 AM
    3 responses
    21 views
    0 likes
    Last Post NinjaTrader_ThomasC  
    Started by f.saeidi, Today, 10:19 AM
    1 response
    5 views
    0 likes
    Last Post NinjaTrader_BrandonH  
    Started by kujista, Today, 06:23 AM
    5 responses
    15 views
    0 likes
    Last Post kujista
    by kujista
     
    Started by traderqz, Today, 12:06 AM
    3 responses
    6 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Started by RideMe, 04-07-2024, 04:54 PM
    5 responses
    28 views
    0 likes
    Last Post NinjaTrader_BrandonH  
    Working...
    X