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