Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Problem Backtest

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

    Problem Backtest

    Hi.

    I would like to make a easy trading strategy with the next rule:

    -Enter Long at Stop at X.

    The problem is that if the open and low of the next bar is above the X point then the order is not executed. How could I to solve this to evaluate it in a backtest? I need that the order must be executed in the open price of the next bar.

    Thank you in advance.

    #2
    Hello Plaket,

    Using a Backtest to test out your Strategy you may want to use the "EnterLong" method to submit a Market Order and NinjaTrader will fill that order on the open of the next bar.

    Then when you want to run your Strategy in real-time you can check to see if the Open/Low is greater than your price "X" to see what type of order that you should use.

    Happy to be of further assistance.
    JCNinjaTrader Customer Service

    Comment


      #3
      Thank you JC.

      I think that there is a mistake here. I would like to know how to solve this problem working with Stop orders.

      For example, I have to develop a strategy with the next rule:

      -Buy at stop at the price of 100.

      If the open of the next bar is 101 then the order is not executed.

      How can I to solve this problem? I need that the strategy enters at the open of the next bar when the open is higher than the stop order price (100). The problem is with the "gaps". If the open of the bar is higher then the order will be not executed. I would like to know how to solve this problem.

      Thank you in advance.

      Comment


        #4
        Hi Plaket,

        You can test for when the that price is above your Stop Price and then re-submit the stop order to change that price. You will need to use unique signal names in this instance.

        Example -
        Code:
        EnterLongStop( stopPrice, "Long1" );
        
        if(Open[0] > stopPrice)
        {
            EnterLongStop( newStopPrice, "Long1" );
        }
        http://www.ninjatrader.com/support/h...erlongstop.htm
        Cal H.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        673 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        379 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        111 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        577 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        582 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X