Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy analyzer with trailing stop strategy

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

    Strategy analyzer with trailing stop strategy

    Hi everybody!

    I'm trying to test a trailing stop strategy in the strategy analyzer, but when I hit run it doesn't return any results.

    The trailing stop system is created in a similar way to the example you offer with the "TrailBuilderExample" strategy, and it works when I run it in real time in simulation, but no result in strategy analyzer.

    What can be caused this?​

    #2
    Hello Carlos19,

    Thank you for your post.

    So I may assist you more accurately, please answer all of the following questions:
    • What version of NinjaTrader are you using? Please provide the entire version number. This can be found under Help -> About (Example: 7.0.1000.? or 8.0.?.?)
    • Do you see results when running the same test on the SampleMACrossover strategy in NinjaTrader with the same settings as your strategy?
    • Who are you connected to for data? This is displayed in green on lower left corner of the Control Center window.
    • Are you connected to your data feed provider when running this test?
    • What instrument(s) (and expiry if applicable) have you selected?
    • What Data Series Type have you selected? Example: Tick, Minute, Day
    • What From and To date is selected?
    • Is your strategy a multi-instrument or multi-time frame strategy?
    • Do you receive an error on the screen? Are there errors on the Log tab of the Control Center? If so, what do these errors report?

    Thanks in advance; I look forward to your reply.

    Comment


      #3
      *Version: 8.0.27.0 64-bit

      *If you mean do I see results with that strategy as is, that's right. If you mean if I see results with that strategy implementing the trailing stop system, I don't get them.

      *Data: My Rithmic for NinjaTrader Brokerage.

      *Yes, the data provider is connected when I test.

      *​Instrument: MES. Expiry: 03-23

      *Data Series Type: 1 minute.

      *Test date: It start at 03/01/2022 and ends in 28/12/2022

      *Doesn´t use multiple instruments or time frames.

      *I don't see any errors in "data center" although I'm not sure I'm looking in the right place either.


      Thanks for your answer.​

      Comment


        #4
        Hello Carlos19,

        Thank you for your reply.

        I am referring to any errors on the Log tab of the Control Center, as shown in the following screenshots:
        World's leading screen capture + recorder from Snagit + Screencast by Techsmith. Capture, edit and share professional-quality content seamlessly.

        World's leading screen capture + recorder from Snagit + Screencast by Techsmith. Capture, edit and share professional-quality content seamlessly.


        For more information about the Log tab:


        Please let me know if you see any error messages here after trying to backtest your trailing stop strategy. One other question as well; is this a strategy that you created yourself or was it imported via a third party?

        I look forward to your reply.

        Comment


          #5
          The only error shown is the one shown in the screenshot, and it is because I have two nt8 licenses, my personal one and the one offered by the funding company I work with, so sometimes I have opened a space for I work with active order flow tools with the license of said active company, and that's why it happens. It shouldn't have anything to do with the mentioned problem, right?
          Attached Files

          Comment


            #6
            Hello Carlos19,

            Thank you for your reply.

            The license message is not related to the lack of results when trying to backtest your strategy. I suggest enabling Trace Orders as well as adding Print() statements to your script to see if any orders are being submitted (and if they are ignored, why) as well as to see if the prints show in the NinjaScript Output window when you run the backtest. This will let you know what parts of your strategy are being hit, even if there are no trade results being shown. If this was modified in the Strategy Builder, you may enable Trace Orders on the Default Properties screen. It is the last option under "More Properties" as shown here:


            For more information about Trace Orders:



            For more information about adding prints to debug and better understand your strategy's behavior, please see the following link:

            Video demonstrating how to add prints in the Strategy Builder: https://drive.google.com/file/d/1CCl...gEIwJKv6L/view

            If you do not understand the output in the NinjaScript Output window after enabling Trace Orders and adding prints, please feel free to share the output here and I'd be glad to take a look and help determine the next steps.

            Please let me know if I may be of further assistance.

            Comment


              #7
              Hello Carlos19,

              In the "TrailBuilderExample" strategy, in "Conditions and Actions" go to the Set 2 and Set 3 and substitute
              this line: State = State.Realtime
              with this: State = State.Historical
              if you want to backtest it.

              Comment


                #8
                Great that KonstantinosNT! It turned out to be just that, I changed the "state" condition and it started working perfectly. Thank you very much to both!

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by NullPointStrategies, Yesterday, 05:17 AM
                0 responses
                62 views
                0 likes
                Last Post NullPointStrategies  
                Started by argusthome, 03-08-2026, 10:06 AM
                0 responses
                134 views
                0 likes
                Last Post argusthome  
                Started by NabilKhattabi, 03-06-2026, 11:18 AM
                0 responses
                75 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