Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

incorrect order fills (back testing)

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

    incorrect order fills (back testing)

    why is it that when i enter protective stop via SetStopLoss() I'm getting incorrectly stopped out? example: xyz closes at 25.00 on a 5-min bar, i have order to go long at 26.00 via EnterLongStop(26.00,"long") and a stop loss order via SetStopLoss(CalculationMode.Price,25.50) if the market "opens@ 25.50 continues higher without returning to this level for day and reaching a intra-high of 28.00. On back tested results I'll show a fill at 26.00 and a stop loss at 25.50 even though the market traded at 25.50 prior to my EnterLongStop(26,"long") being executed and never returned back to this level! I wouldn't have had an open position when the market traded at 25.50 so therefore it's impossible for me to had been stopped out!
    Last edited by d.allen101; 11-13-2009, 02:16 PM.

    #2
    When you are backtesting you do not have intrabar granularity. You have no information on whether or not price retraced back down to that price and it could have very well done so. As such, if the price exists on the bar, it will stop you out to prevent overstating of your performance results.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      so in order to avoid this i would have to use multi-time frames? continue on generating the signal in the higher time frame i.e. 5-mins and execute the trades in lower time frame i.e. 1 min? so, if i add 1 bars and use 5 min bars as my primary bars and enter all orders in the lower time frame i.e. EnterLongStop(1,1,"long") and SetStopLoss("long",CalculationMode.Price,26.00,tru e) this should work fine?
      Last edited by d.allen101; 11-13-2009, 03:15 PM.

      Comment


        #4
        When moving to multi-time frame you would probably be best served using explicit exit orders with ExitLongStop().
        Josh P.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by ETFVoyageur, Today, 12:52 AM
        1 response
        9 views
        0 likes
        Last Post Leeroy_Jenkins  
        Started by Tin34, Today, 03:30 AM
        0 responses
        4 views
        0 likes
        Last Post Tin34
        by Tin34
         
        Started by lollers, Today, 03:26 AM
        0 responses
        6 views
        0 likes
        Last Post lollers
        by lollers
         
        Started by aliyahany, Today, 03:16 AM
        0 responses
        1 view
        0 likes
        Last Post aliyahany  
        Started by mariajvillarrealr, Today, 02:57 AM
        0 responses
        1 view
        0 likes
        Last Post mariajvillarrealr  
        Working...
        X