• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

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 webus, Today, 02:03 AM
          0 responses
          7 views
          0 likes
          Last Post webus
          by webus
           
          Started by momchi, Yesterday, 07:12 PM
          1 response
          15 views
          0 likes
          Last Post NinjaTrader_ChrisSch  
          Started by DieSlower, Yesterday, 11:02 PM
          0 responses
          5 views
          0 likes
          Last Post DieSlower  
          Started by gujungg, Yesterday, 10:59 PM
          0 responses
          12 views
          0 likes
          Last Post gujungg
          by gujungg
           
          Started by DieSlower, Yesterday, 09:46 PM
          0 responses
          13 views
          0 likes
          Last Post DieSlower  
          Working...
          X