Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Getting errors when simulating the Profittargettrailingstop_101B in PlayBack

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

    Getting errors when simulating the Profittargettrailingstop_101B in PlayBack

    I downloaded and installed the Profittargettrailingstop_101B. Started it in Playback on the ES on a 15 minute chart.

    It trades for a few seconds (in max speed, but I tried lower speeds and run into the same errors) - and then it hits errors.

    Any idea?


    #2
    Hello ZivGillat,

    Thanks for your message.

    Set methods will prep NinjaTrader so target and stop are submitted on the fill of an entry order. The stop is submitted first, and then the profit target, and both orders are tied with OCO.

    In this case, the strategy is prepped to submit a stop loss at a certain level, and when the entry order executes, that stop loss level is invalid and then causes a rejection. The profit target gets submitted next, and since the stop loss order which is tied with the same OCO ID was already rejected, the target gets rejected since the OCO ID is now invalid.

    When the strategy receives an order error, it will panic and abort.

    You may modify the strategy to ensure that an initial stop loss is submitted when the strategy is flat before the next entry is made. I.E. before line 109 where the entry logic is located.

    I've also asked Paul to have a look at making modifications so this is done in his example. He is out of the office at this time and the task will have to be worked on as resources allow.

    It is also possible to have the strategy trap order rejections and take a different action using RealtimeRrrorHandling.

    RealtimeErrorHandling

    To prevent the strategy from being deactivated when an order error occurs, you can set the strategy's RealtimeErrorHandling property to IgnoreAllErrors. StopCancelCloseIgnoreRejects will keep the strategy running for rejections but not for other order errors like a failure to change an order. With this property set, you can then trap order errors in OnOrderUpdate if you would like to have the strategy attempt a different action.

    RealtimeErrorHandling - https://ninjatrader.com/support/help...orhandling.htm

    OnOrderUpdate() - https://ninjatrader.com/support/help...rderupdate.htm

    We look forward top assisting.
    JimNinjaTrader Customer Service

    Comment


      #3
      Hi Jim,

      Sounds great. Thank you. I'll keep experiment by adding the trap code and will also await for Paul's mods. THANK YOU.

      Comment


        #4
        Hello ZivGillat,

        I've sent an update to the NT User apps for the ProfitTargetTrailingStop. It should be posted in the next day or two.

        I suspect the issue you were having was caused by running the strategy with the default of Calculate.OnBarClose which would cause a trailing stop to potentially be moved to an incorrect price. I changed the default to Calculate.OnPriceChange. Also, per Jim's request, I did relocate the entry section as well.
        Paul H.NinjaTrader Customer Service

        Comment


          #5
          Paul and Jim,

          You're both rock stars. THANK YOU !!!

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Aviram Y, Today, 05:29 AM
          4 responses
          11 views
          0 likes
          Last Post Aviram Y  
          Started by algospoke, 04-17-2024, 06:40 PM
          3 responses
          26 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Started by bmartz, 03-12-2024, 06:12 AM
          3 responses
          30 views
          0 likes
          Last Post NinjaTrader_Zachary  
          Started by gentlebenthebear, Today, 01:30 AM
          1 response
          8 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Started by cls71, Today, 04:45 AM
          1 response
          7 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Working...
          X