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 Mindset, 04-21-2026, 06:46 AM
      0 responses
      90 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      135 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      68 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by cmoran13, 04-16-2026, 01:02 PM
      0 responses
      119 views
      0 likes
      Last Post cmoran13  
      Started by PaulMohn, 04-10-2026, 11:11 AM
      0 responses
      69 views
      0 likes
      Last Post PaulMohn  
      Working...
      X