Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

EMA CrossAbove

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

    EMA CrossAbove

    Hi,

    I have this code in a strategy to mark when the medium ema value crosses above a slow ema value. The values can be entered in with the user interface..

    Code is this where I want to start to do something...

    if (CrossAbove(emaMedium, emaSlow, 8))

    Does this mean that all 8 bars have to meet this condition all just 1 bar in 8?

    But what is happening is It marks a point when emaMedium is below the emaslow when 1 bar has the medium ABOVE the slow....which I don't want to do.


    Thanks..
    Last edited by traderhawk; 12-20-2021, 07:59 PM.

    #2
    Hello traderhawk,

    Thanks for your post.

    When creating CrossAbove()/CrossBelow() conditions, the lookback period determines the number of bars back to check for the cross above condition.

    For example, if you call (CrossAbove(emaMedium, emaSlow, 8)) then this will look to see if emaMedium crosses above emaSlow within the last 8 bars.

    See this help guide page for more information: https://ninjatrader.com/support/help...crossabove.htm

    Let us know if we may assist further.

    <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CaptainJack, 05-29-2026, 05:09 AM
    0 responses
    169 views
    0 likes
    Last Post CaptainJack  
    Started by CaptainJack, 05-29-2026, 12:02 AM
    0 responses
    88 views
    0 likes
    Last Post CaptainJack  
    Started by charlesugo_1, 05-26-2026, 05:03 PM
    0 responses
    128 views
    0 likes
    Last Post charlesugo_1  
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    208 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    185 views
    0 likes
    Last Post CarlTrading  
    Working...
    X