Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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.​
    Kate W.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by RaddiFX, Today, 10:15 AM
    2 responses
    14 views
    0 likes
    Last Post RaddiFX
    by RaddiFX
     
    Started by patrickmlee007, Today, 09:33 AM
    2 responses
    17 views
    0 likes
    Last Post patrickmlee007  
    Started by magnatauren, 08-15-2020, 02:12 PM
    5 responses
    206 views
    0 likes
    Last Post RaddiFX
    by RaddiFX
     
    Started by rene69851, 05-02-2024, 03:25 PM
    1 response
    22 views
    0 likes
    Last Post rene69851  
    Started by ETFVoyageur, Yesterday, 07:05 PM
    5 responses
    45 views
    0 likes
    Last Post ETFVoyageur  
    Working...
    X