Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Replay and ATM problem

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

    Replay and ATM problem

    I've been experiencing an intermittent problem in playback when I have a strategy running that calls to an ATM template. When some trades are taken the position appears filled but the stop and targets nor the trailing parameters of the called ATM strategy are applied. Also the position just looks unfilled to the system as other trades will be taken by the strategy later on even though the strategy is programmed not to take trades if in an existing position. I thought it was because I was replaying to fast, but it also is replicated at 1x speed, and always at the same effected entries. Is this a known bug? Is it bad replay data?

    Thanks,

    Philip

    #2
    Are there error messages in the Log tab of the Control Center window? Since you state this is happening on specific entries, is it possible that the ATM orders are generated but rejected due to invalid price of an order at that specific time? Such a sell stop loss that is above the market price?
    RayNinjaTrader Customer Service

    Comment


      #3
      OK I saw what was happening. No errors in the log, the strategy is the type of OnBarUpdate=false, and if the condition is no longer valid the order is immediately cancelled. Right at bar close the conditions were no longer valid and the strategy was cancelled, however the position was still filled. It happens simultaneously, so I was left with a position without a strategy.

      Today I was running this same strategy on another day and it was going along fine until it reached one entry and decided to fill repeatedly until bar close, with no ATM strategy being applied to the entries. Again no errors in the log. I rewound to play it over again and the behavior was repeated. I then cleared the strategy, then re-applied it and replayed it it worked fine. So it seems there is some flakiness with the replay behavior when calling to an ATM Strategy.

      Ideas Welcome.

      -Philip

      Comment


        #4
        I would need a reproducible data set from you in order to understand what may be happening.

        You state that the order was cancelled but a position was still created. That would mean that the order was not cancelled. I assume you are using AtmStrategyCreate() to submit the entry order and AtmStrategyCancelEntryOrder() to cancel it?

        Ray
        RayNinjaTrader Customer Service

        Comment


          #5
          Ray,

          Using AtmStrategyClose() as I was having trouble with another other script canceling orders via AtmStrategyCancelEntryOrder(). I can email replay data and strategy if you want.

          Comment


            #6
            I would suggest using Cancel(), if you run into problems, we can look at that. If the situation is not reproducible then the current data will not be that helpful since I could run it 100x and not know what to look for. Thanks for the offer though.
            RayNinjaTrader Customer Service

            Comment


              #7
              Ray, I ran it again and it still produced an extra entry that doesn't have an ATM strategy applied. I will work on the Close method and let you know.

              Comment


                #8
                Ray,

                I used the Close() method and it seems to be working correctly.

                Thanks.

                Comment


                  #9
                  Great, thanks for reporting back.
                  RayNinjaTrader Customer Service

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by usazencort, Today, 01:16 AM
                  0 responses
                  1 view
                  0 likes
                  Last Post usazencort  
                  Started by kaywai, 09-01-2023, 08:44 PM
                  5 responses
                  603 views
                  0 likes
                  Last Post NinjaTrader_Jason  
                  Started by xiinteractive, 04-09-2024, 08:08 AM
                  6 responses
                  22 views
                  0 likes
                  Last Post xiinteractive  
                  Started by Pattontje, Yesterday, 02:10 PM
                  2 responses
                  20 views
                  0 likes
                  Last Post Pattontje  
                  Started by flybuzz, 04-21-2024, 04:07 PM
                  17 responses
                  230 views
                  0 likes
                  Last Post TradingLoss  
                  Working...
                  X