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 Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            648 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            369 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            109 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            573 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            575 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X