Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Simple backtest not working

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

    #16
    Thanks Adam, I am able to get it to work by changing sessions.
    I had another question: If I want to use a daily period for the signal entry and a intraday period for the trailing stop, how do I set the trailing stop to trigger off of the 5 min bars? I know about adding the bars objects, but do I add the 5 min bars as a parameter to the Trailing Stop?

    Comment


      #17
      the ddKeltnerChannel indicator

      The Keltner channel included with NT uses SMA of the typical price as the center line and SMA at an offset. My version uses EMA of the close as the center line and ATR at an offset as suggested by Linda Raschke. Also, the ATR has its own period which can be different than the EMA period. I could not find out whether the EMA is based on close or typical price so I used close. I'll later modify ddKeltnerChannel to accommodate both close and typical price.

      Doug D

      Comment


        #18
        Originally posted by Asing View Post
        Thanks Adam, I am able to get it to work by changing sessions.
        I had another question: If I want to use a daily period for the signal entry and a intraday period for the trailing stop, how do I set the trailing stop to trigger off of the 5 min bars? I know about adding the bars objects, but do I add the 5 min bars as a parameter to the Trailing Stop?
        You would need to use the 5 minute bar objects in the calculation you are using for your stop loss.

        Please take a look at our reference sample on Entering on one time frame and exiting on another:

        MatthewNinjaTrader Product Management

        Comment


          #19
          I get a NinjaScript error msg when I try to import this file

          Comment


            #20
            Hello Asing,

            This file imports successfully here. Please make sure you click No when it asks to overwrite any files starting with @.

            If yours does not import due to existing errors, please see this post which details how to identify and resolve:
            Ryan M.NinjaTrader Customer Service

            Comment


              #21
              Yes, I got it now. Thanks

              Comment


                #22
                If I am using the second data set for a Trailing Stop do I still need to initialize the SettrailingStop; and do I place the SetTrailingStop a second time in OnBarUpdate method after using a "If (BarsinProgress) statement ?

                Comment


                  #23
                  You would want to use this in OnBarUpdate after the BarsInProgress statement.
                  MatthewNinjaTrader Product Management

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                  0 responses
                  648 views
                  0 likes
                  Last Post Geovanny Suaza  
                  Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                  0 responses
                  369 views
                  1 like
                  Last Post Geovanny Suaza  
                  Started by Mindset, 02-09-2026, 11:44 AM
                  0 responses
                  108 views
                  0 likes
                  Last Post Mindset
                  by Mindset
                   
                  Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                  0 responses
                  572 views
                  1 like
                  Last Post Geovanny Suaza  
                  Started by RFrosty, 01-28-2026, 06:49 PM
                  0 responses
                  574 views
                  1 like
                  Last Post RFrosty
                  by RFrosty
                   
                  Working...
                  X