Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Live Trading Behaving Differently Than Backtest

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

    Live Trading Behaving Differently Than Backtest

    Greetings,

    I've developed a strategy that backtests fine, but when I went live with it, it enterd a position and then exited 6 seconds later for no apparent reason. There were some pop ups (coudn't tell if they were from NT or broker - something to the effect of overfill). I have set a variable to set the quantity to trade - a very minimal amount just for testing live and in no way was over what my account could handle. I have attached the initialize and onbarupdate methods below - thank you for any and all assistance.

    hbmiles2000
    Last edited by hbmiles2000; 08-25-2011, 09:18 AM.

    #2
    Further to question below, I have a dynamic stop built in, but the settings on it should not have triggered the exit when it went live (wasn't even close); and again, it backtests fine.
    Thank you,
    hbmiles2000

    Comment


      #3
      hbmiles2000, generally spoken live or simulated live trading is expected to show some degree of differences from backtesting : http://www.ninjatrader.com/support/h...ime_vs_bac.htm

      The script would also behave differenly in realtime, since you're working with CalculateOnBarClose = false. This would always be true in backtesting and as such not provide any intrabar calculation results. For the benefit of debugging your code you should give it a run in Market Replay to see where it would not work as you expected :

      Comment


        #4
        Thanks, Bertrand, but that was really not a big help. It seems like a straight forward question, and I supplied the code, so I don't understand why I usually get run-around answers from this forum.
        Thank you,
        hbmiles2000

        Comment


          #5
          hbmiles2000,

          Generally we are not able to offer custom coding or debugging services. There are tools available to use to track what your strategy is doing, and using these tools is really the only way to get a complete picture on strategy operation. Please see the link below for help using TraceOrders and Print statements to verify behavior.


          If you are looking for personalized strategy debugging, this is offered by some of our partners. Please see the link below for a list of our 3rd party NinjaScript consultants:
          Ryan M.NinjaTrader Customer Service

          Comment


            #6
            Ryan,

            thanks - I've referenced some of your suggestions and they have helped.
            thx,
            hbmiles2000
            Last edited by hbmiles2000; 08-28-2011, 04:31 PM. Reason: mistake

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by charlesugo_1, 05-26-2026, 05:03 PM
            0 responses
            55 views
            0 likes
            Last Post charlesugo_1  
            Started by DannyP96, 05-18-2026, 02:38 PM
            1 response
            142 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by CarlTrading, 05-11-2026, 05:56 AM
            0 responses
            160 views
            0 likes
            Last Post CarlTrading  
            Started by CarlTrading, 05-10-2026, 08:12 PM
            0 responses
            96 views
            0 likes
            Last Post CarlTrading  
            Started by Hwop38, 05-04-2026, 07:02 PM
            0 responses
            276 views
            0 likes
            Last Post Hwop38
            by Hwop38
             
            Working...
            X