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 NullPointStrategies, Yesterday, 05:17 AM
      0 responses
      64 views
      0 likes
      Last Post NullPointStrategies  
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      139 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      75 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      45 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      50 views
      0 likes
      Last Post TheRealMorford  
      Working...
      X