Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Sim to Real

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

    Sim to Real

    What would cause entry at the close of the trigger bar rather than the open when switching between sim and real trading bar trading?

    #2
    Hi occam,

    There's not one cause that springs to mind. Strategies should function similarly when applied to sim account or live account. CalculateOnBarClose determines whether conditions are evaluated on tick by tick basis or on bar close.

    The bar closing event and the next bar open are the same event so maybe you're seeing an issue with how your execution is plotted? Please review the link below on this:


    In order to evaluate strategy behavior on either sim or live account, you need debugging tools like TraceOrders output and print statements.
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Would mixing stoploss and profit target mixing be a problem if there are precedence rules?

      Comment


        #4
        I'm sorry - I don't follow your last reply. Can you please clarify or provide a code snippet along with what you expect to happen with it?
        Ryan M.NinjaTrader Customer Service

        Comment


          #5
          Originally posted by NinjaTrader_RyanM View Post
          I'm sorry - I don't follow your last reply. Can you please clarify or provide a code snippet along with what you expect to happen with it?
          I asked occam to aid me in developing a code that will result in a closer approximation in the backtest with a sim chart. If the profit target and stop loss occur in the same bar the stop loss takes precedence over the profit target even though the profit target may be hit before the stop loss. Using tick data helps with this problem but you can still get a stop loss even though the profit target is hit first. Is there a way for the backtest to be delayed so that it always enters at the beginning of the next bar? I feel this may help to some extent with this problem.
          Thanks
          Jerry

          Comment


            #6
            Hi Jerry,

            In a backtest, orders are submitted on the bar after the condition evaluates to true. This is not configurable.

            This sample can help you achieve intrabar granularity in a backtest:


            You have to move away from the Set statements, and use for example ExitLongLimit() and ExitStopLimit() for your stop loss and target orders.
            Ryan M.NinjaTrader Customer Service

            Comment


              #7
              Hi Ryan
              Thanks for your assistance
              Jerry

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Jltarrau, Today, 05:57 AM
              0 responses
              3 views
              0 likes
              Last Post Jltarrau  
              Started by f.saeidi, Today, 05:56 AM
              1 response
              2 views
              0 likes
              Last Post Jltarrau  
              Started by Stanfillirenfro, Yesterday, 09:19 AM
              7 responses
              51 views
              0 likes
              Last Post NinjaTrader_Gaby  
              Started by TraderCro, 04-12-2024, 11:36 AM
              4 responses
              70 views
              0 likes
              Last Post Mindset
              by Mindset
               
              Started by Mindset, Yesterday, 02:04 AM
              1 response
              15 views
              0 likes
              Last Post Mindset
              by Mindset
               
              Working...
              X