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 CarlTrading, 03-31-2026, 09:41 PM
      1 response
      81 views
      1 like
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      42 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      64 views
      2 likes
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      66 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      54 views
      0 likes
      Last Post CarlTrading  
      Working...
      X