Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Backtesting Performance w Market Replay

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

    Backtesting Performance w Market Replay

    Hello, I can't find on the forum a similar question, wandering if I am the first one and probably wrong.
    I bought a strategy based on order flow that can be back-tested only using Market Replay or paper with live data.
    To save time I use Market Replay at max speed and also right click on the chart and go to "strategy performance->RealTime or Hsitorical or Both".
    Even though I see the trades on the playback101 account the strategy performance panel doesn't see any trade.
    What should I do? Is it at all possible?

    #2
    Hello giogio1,

    Thank you for your post.

    Do you get the same behavior when testing the Sample MA Crossover strategy in Playback? I just ran a test with that strategy on ES 12-23 for yesterday's date, October 17th. I enabled the strategy on a chart, set the speed to max, and I was able to see the Strategy Performance results for historical, real-time, and both. If this test works with Sample MA Crossover but not for the strategy you bought, please check the Log tab of the Control Center for any error messages. I also suggest checking the Strategies tab of the Control Center to double-check the color of the strategy name; green would mean it is in sync and ready to submit orders to the playback101 account but yellow-orange means the strategy is not in sync and will not submit orders to the playback101 account yet.

    You could also try checking the strategy performance from the Strategies tab of the Control Center. For more information about viewing strategy performance on a chart and from the Strategies tab, please see the help guide pages below:Please let me know if I may be of further assistance.

    Comment


      #3
      Thank you Emily, I tested it as you suggested and I see that with Sample MA Crossover works as you say it, but with SampleAtmStrategy it does not which makes an evaluation of an Atm based strategy very difficult.
      Can you confirm? Is there a solution for it?
      Best
      G

      Comment


        #4
        Hello G,

        Thank you for your reply.

        I had not realized you were working with ATM strategies in your NinjaScript strategy and that is the reason you must test it in a real-time environment. It is mentioned in the help guide that "Executions from ATM Strategies will not have an impact on the hosting NinjaScript strategy position and PnL - the NinjaScript strategy hands off the execution aspects to the ATM, thus no monitoring via the regular NinjaScript strategy methods will take place (also applies to strategy performance tracking)"


        You would need to instead utilize the Trade Performance window of the platform:


        Please let us know if we may be of further assistance.

        Comment


          #5
          Nice! Thank you Emily. It works well.
          I have two addition question specific to the SampleAtmStrategy..

          - I understand that the method AtmStrategyCreate() does not actually create an Atm from scratch but only launch (and modify) a preexisting Atm that I had created manually. Is that correct? I cannot actually create from scratch a new Atm (with a new name) via script, correct?

          - In the sample code I see "AtmStrategyChangeStopTarget(0, Low[0] - 3 * TickSize, "STOP1", atmStrategyId);"
          where the stop price seems to be assigned in absolute value "Low[0] - 3 * TickSize", not relative to the average price or direction of the trade. In a way the sample code wouldn't make much sense when I go short and that's OK because it is just a sample. Do I understand it correctly?
          Thank you!
          G

          Comment


            #6
            Hello G,

            I have addressed your questions below:

            - I understand that the method AtmStrategyCreate() does not actually create an Atm from scratch but only launch (and modify) a preexisting Atm that I had created manually. Is that correct? I cannot actually create from scratch a new Atm (with a new name) via script, correct?
            • Correct, an ATM strategy template may not be created from scratch within a script. The template must be manually created and saved prior to accessing it in the script. This is why the SampleAtmStrategy script has the following comment in line 58:
            • Code:
                          // **** YOU MUST HAVE AN ATM STRATEGY TEMPLATE NAMED 'AtmStrategyTemplate' CREATED IN NINJATRADER (SUPERDOM FOR EXAMPLE) FOR THIS TO WORK ****
              	​

            - In the sample code I see "AtmStrategyChangeStopTarget(0, Low[0] - 3 * TickSize, "STOP1", atmStrategyId);"
            where the stop price seems to be assigned in absolute value "Low[0] - 3 * TickSize", not relative to the average price or direction of the trade. In a way the sample code wouldn't make much sense when I go short and that's OK because it is just a sample. Do I understand it correctly?​Thank you for your time and patience.

            Comment


              #7
              Clear, Thank you Emily!
              Can use the GetAtmStrategyPositionAveragePrice()​ to be able to calculate my stop relative to the entry?

              Comment


                #8
                Hello giogio1,

                Thank you for your reply.

                The stops would be initially calculated based on the ATM strategy template used in the script. Based on the parameter type when setting up the template for the ATM strategy, you could set up the stop based on an offset from the average entry price. The details for creating an ATM strategy may be found here:


                Then, a stop or target could be modified either manually or programmatically. If you were to change the stop with AtmStrategyChangeStopTarget() you could change the stop price and yes, GetAtmStrategyPositionAveragePrice() would provide you the average entry price of the ATM strategy so you could use it to calculate a new stop value that you could use when calling AtmStrategyChangeStopTarget():Please let us know if we may be of further assistance.

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by NullPointStrategies, Yesterday, 05:17 AM
                0 responses
                58 views
                0 likes
                Last Post NullPointStrategies  
                Started by argusthome, 03-08-2026, 10:06 AM
                0 responses
                133 views
                0 likes
                Last Post argusthome  
                Started by NabilKhattabi, 03-06-2026, 11:18 AM
                0 responses
                73 views
                0 likes
                Last Post NabilKhattabi  
                Started by Deep42, 03-06-2026, 12:28 AM
                0 responses
                45 views
                0 likes
                Last Post Deep42
                by Deep42
                 
                Started by TheRealMorford, 03-05-2026, 06:15 PM
                0 responses
                50 views
                0 likes
                Last Post TheRealMorford  
                Working...
                X