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 Sparkyboy, Today, 10:57 AM
    0 responses
    1 view
    0 likes
    Last Post Sparkyboy  
    Started by TheMarlin801, 10-13-2020, 01:40 AM
    21 responses
    3,916 views
    0 likes
    Last Post Bidder
    by Bidder
     
    Started by timmbbo, 07-05-2023, 10:21 PM
    3 responses
    152 views
    0 likes
    Last Post grayfrog  
    Started by Lumbeezl, 01-11-2022, 06:50 PM
    30 responses
    809 views
    1 like
    Last Post grayfrog  
    Started by xiinteractive, 04-09-2024, 08:08 AM
    3 responses
    11 views
    0 likes
    Last Post NinjaTrader_Erick  
    Working...
    X