Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Bar Low vs EMA

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

    Bar Low vs EMA

    I have an issue with indicator showing bars not at the right position vs 21 EMA.
    Here is a piece of code:
    Code:
                    && (((Low[0] < (EMA(21)[0])) && ((high1 > ema1)
    Just to let you know it happened yesterday at around 9:36 Eastern Time on ES futures contract.

    Indicator supposed to show only bars which are below 21 EMA for short (red circle) but the bar's low (red circle) is clearly at 21 EMA where it supposed to be below 21 EMA.
    Could you please help me and let me know how should I correct the code?


    Attached Files

    #2
    Hello Ludwik,

    Thank you for your note.

    It's pretty difficult to tell whether that Low price is actually below the EMA price. The first thing I would suggest would be to print the values of Low[0] and EMA(21)[0] along with the Time[0] value for each bar to confirm whether the low of that bar was below or not.

    This forum post goes into great detail on how to use prints to help figure out where issues may stem from — this should get you going in the correct direction. You can even add these using the Strategy Builder.

    https://ninjatrader.com/support/foru...ns-not-working

    If you run into issues like we saw here, the above information will allow you to print out all values used in the condition in question that may be evaluating differently. With the printout information you can assess what is different between the two.

    Please let us know if we may be of further assistance to you.​

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    646 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    367 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    108 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    570 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    573 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X