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

Plot EMA21Envelope from an indicator script

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

    Plot EMA21Envelope from an indicator script

    Hi,

    I am looking for help on how to plot EMA Envelope line from within an indicator script in NT 8 environment.

    I had a NT7 indicator that worked fine with the following:
    Under initialize:
    Add(new Plot(new Pen(Color.Cyan, 2), "Plot21Up" )); Plots[0].Pen.DashStyle = DashStyle.Dash;
    Under OnBarUpdate:
    Plot21Up.Set(MAEnvelopes(newPrcnt,1,21).Upper[0]);
    This was working fine.

    Moving to NT8, I converted it to the following:
    Under State.SetDefaults:
    AddPlot(new Stroke(Brushes.Cyan), PlotStyle.Line,"Plot21Up"); Plots[0].DashStyleHelper = DashStyleHelper.Dash;
    Under OnBarUpdate:
    Plot21Up.Set(MAEnvelopes(newPrcnt,1,21).Upper[0]);

    The .Set is not recognized anymore.
    I tried the following and it is not working as well:
    Plot21Up = MAEnvelopes(newPrcnt,1,21).Upper[0];
    nor
    Plots[0] = MAEnvelopes(newPrcnt,1,21).Upper[0];

    Thank You

    #2
    Hello Hgheith,

    Thank you for writing in.

    If you replace,

    Plot21Up = MAEnvelopes(newPrcnt,1,21).Upper[0];

    With,

    Value[0] = MAEnvelopes(newPrcnt,1,21).Upper[0];

    The plot should work.

    Please see the following reference example for setting plot values in NT8.


    Please let us know if you need further assistance.
    Alan P.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by itrader46, Today, 09:04 AM
    0 responses
    3 views
    0 likes
    Last Post itrader46  
    Started by timmbbo, Today, 08:59 AM
    0 responses
    1 view
    0 likes
    Last Post timmbbo
    by timmbbo
     
    Started by bmartz, 03-12-2024, 06:12 AM
    5 responses
    33 views
    0 likes
    Last Post NinjaTrader_Zachary  
    Started by Aviram Y, Today, 05:29 AM
    4 responses
    14 views
    0 likes
    Last Post Aviram Y  
    Started by algospoke, 04-17-2024, 06:40 PM
    3 responses
    28 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Working...
    X