Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Entry when signal is 10 bars old + Entry when signal is not given in current bar

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

    Entry when signal is 10 bars old + Entry when signal is not given in current bar

    Hello,

    Topic 1

    I´d like to entry when my strategy trigger but after 10 bars from the signal.

    LONG signal > wait 10 Bars > entry

    ____________________________________


    Topic 2

    How is it possible to entry when Signal is not valid anymore ?

    So in the first bar where the signal is not true anymore, but only one trade, not every new bar then.

    Thank you

    #2
    Topic 1 - save entry signal bar to something
    bool SavedBar = CurrentBar

    AND THEN
    if (CurrentBar > SavedBar + 9)
    {
    your entry logic
    }

    Comment


      #3
      Hello Uregon,

      UltraNIX is providing good information, but that should be a class level variable so it is not reset on each pass of OnBarUpdate().
      private bool savedBar;

      if (/* conditions to set trigger */)
      {
      savedBar = CurrentBar;
      }

      if (CurrentBar > savedBar + 9)
      {
      // trigger action
      }


      NinjaTrader_PaulH has an example of this in the Strategy Builder.
      with regard to the attached image: Line A is an indicator Line B is the m period MAX of line A Line C is an average of this indicator A Line D is another average of this indicator A is it possible, possibly using the strategy builder, but without adding a temporary variable, to set on the condition: line C crosses below line D
      Chelsea B.NinjaTrader Customer Service

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by CaptainJack, 05-29-2026, 05:09 AM
      0 responses
      477 views
      0 likes
      Last Post CaptainJack  
      Started by CaptainJack, 05-29-2026, 12:02 AM
      0 responses
      317 views
      0 likes
      Last Post CaptainJack  
      Started by charlesugo_1, 05-26-2026, 05:03 PM
      0 responses
      256 views
      1 like
      Last Post charlesugo_1  
      Started by DannyP96, 05-18-2026, 02:38 PM
      1 response
      340 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 05-11-2026, 05:56 AM
      0 responses
      308 views
      0 likes
      Last Post CarlTrading  
      Working...
      X