• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

HighLow Values of indicator in non-primary BarsArray

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

    HighLow Values of indicator in non-primary BarsArray

    This draws a short horizontal line at the EMA20 of BarsArray1.

    DrawLine("Tag1", false, 10, (EMA(BarsArray[1],20))[0], 0, (EMA(BarsArray[1],20))[0], Color.Red, DashStyle.Solid, 2);

    How do I get to the High or Low of this EMA 20?

    I tried
    (EMA(High,BarsArray[1], 20))[0] and also (EMA(BarsArray[1],(High,20)))[0] - neither of which works. I would appreciate some help.

    sandman

    #2
    Hello sandman,

    Use the Highs collection with an index of 1.

    Below is a public link to the help guide on Highs.
    https://ninjatrader.com/support/help.../nt7/highs.htm

    In the scope of the class:
    private EMA myEMA;

    In OnStartUp():
    myEMA = EMA(Highs[1], 20);

    In OnBarUpdate():
    if (BarsInProgress == 1)
    Print(myEMA[0]);
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Rednael90, Today, 07:22 AM
    0 responses
    7 views
    0 likes
    Last Post Rednael90  
    Started by dadarara, Today, 02:42 AM
    0 responses
    4 views
    0 likes
    Last Post dadarara  
    Started by TraderYoda, 10-17-2018, 09:06 AM
    14 responses
    163 views
    1 like
    Last Post TraderYoda  
    Started by Johnny Santiago, Yesterday, 09:31 PM
    0 responses
    7 views
    0 likes
    Last Post Johnny Santiago  
    Started by DarkCloudCover, Yesterday, 07:29 PM
    1 response
    28 views
    1 like
    Last Post TraderYoda  
    Working...
    X