Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to say: EMA fast "has not crossed" EMA slower during the last n bars

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

    How to say: EMA fast "has not crossed" EMA slower during the last n bars

    I'm writing a strategy about a moving average cross that includes a criteria that the cross happens after a steady course of action in the opposite direction.
    In the strategy builder, I'm writing the lines like this :
    EMA fast n bars ago< EMA slower n bars ago
    EMA fast n-1 bars ago< EMA slower n-1 bars ago
    EMA fast n-2 bars ago< EMA slower n-2 bars ago
    repeat above lines until 1 bar ago.

    Is there a faster way to do this?
    Ideally, there is a function in Strategy Builder that I don't know about, like "does not cross above/below" with a look back period.

    Thanks.

    #2
    I think I found my own answer. I clicked on the Help Guide from the control panel in NT8 desktop,
    Navigated to Operations.
    Navigated to the Strategy Builder,
    Navigated to the Condition Builder.
    Clicked on the "Negating a Condition" section.

    Comment


      #3
      I also separated the tabs, so that the "has not crossed" tab sets a trigger variable to true, nothing in this tab resets the trigger.
      Then in the next tab if it does cross & the trigger is set to true, I take and entry/exit action and reset the trigger to false.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by CarlTrading, 03-31-2026, 09:41 PM
      1 response
      47 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      23 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      33 views
      1 like
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      50 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      42 views
      0 likes
      Last Post CarlTrading  
      Working...
      X