Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
How do I add 20 perior EMA of 5 min chart to a 14 tick Renko chart
Collapse
X
-
All you need to do is add the series and then plot it. The value you pass in to the plot can be used for your other calculations as well. Something like the following snippet would accomplish this.
I am also including the relevant help guide documents for the above snippet.Code:private EMA myEMA; protected override void OnStateChange() { if (State == State.SetDefaults) { AddPlot(Brushes.Yellow, "myEMA"); } else if (State == State.Configure) { AddDataSeries("ES 09-18",BarsPeriodType.Minute, 5); } else if(State==State.DataLoaded) { myEMA = EMA(BarsArray[1],20); } } protected override void OnBarUpdate() { if (BarsInProgress==1 && CurrentBars[1]<20)return; Value[0] = myEMA[0]; }
Help Guide - AddPlot()
Help Guide- AddDataSeries()
Help Guide - BarsArray
Help Guide - Multi-Time Frame & Instruments
Let me know if you have any questions.Josh G.NinjaTrader Customer Service
Comment
-
Sorry about that. This would be done differently with NT7. Check out the following reference sample that demonstrates a nice workaround on how to plot from a strategy in NT7.
Help Guide - Plotting from within a NinjaScript strategy
Help Guide - BarsArray
Help Guide - Add()
Help Guide - Multi Time Frame and Instruments
EDIT: MistakeLast edited by NinjaTrader_JoshG; 04-25-2019, 12:58 PM.Josh G.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by CaptainJack, 05-29-2026, 05:09 AM
|
0 responses
262 views
0 likes
|
Last Post
by CaptainJack
05-29-2026, 05:09 AM
|
||
|
Started by CaptainJack, 05-29-2026, 12:02 AM
|
0 responses
168 views
0 likes
|
Last Post
by CaptainJack
05-29-2026, 12:02 AM
|
||
|
Started by charlesugo_1, 05-26-2026, 05:03 PM
|
0 responses
170 views
1 like
|
Last Post
by charlesugo_1
05-26-2026, 05:03 PM
|
||
|
Started by DannyP96, 05-18-2026, 02:38 PM
|
1 response
257 views
0 likes
|
Last Post
|
||
|
Started by CarlTrading, 05-11-2026, 05:56 AM
|
0 responses
209 views
0 likes
|
Last Post
by CarlTrading
05-11-2026, 05:56 AM
|

Comment