Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Rate of Change
Collapse
X
-
Rate of Change
Hi, I've written script to calculate the SMA and plot it. I would now like to compare the rate of change of those SMA points such as the most recent SMA point , SMA[0] vs the SMA of 5 bars ago, SMA[5]. I would also, if possible, like to change the color of the plotted line to reflect positives and negatives rate of change. Could you please provide some guidance? Script is enclosed.Tags: None
-
Kay, you can check into this reference sample for how to achieve plot color changes - http://www.ninjatrader-support2.com/...ead.php?t=3227
The condition in the sample is just a Rising, Falling one, you could replace this then with your custom needed one (i.e. if (SMA[0] > SMA[5]....)BertrandNinjaTrader Customer Service
-
Hi Bertrand,
I followed most of the code but couldn't get a plot. I suspect it's the SMA(fastperiod)[0] >SMA(fastperiod)[5] portion that I've gotten wrong. Would you mind taking a look? It's to compare whether the current SMA(fastperiod) is greater than SMA(fastperiod) of 5 bars ago. Code is attached.
Thanks.
Kay WaiAttached Files
Comment
-
Thanks Bertrand!
Just one observation. When I add a separate "slower" SMA Line, i.e having 2 SMA lines running from the same script, some points don't even appear on the chart. So I separated the SMA lines into 2 different files. Looks just the way I wanted it!
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by emapleq, Today, 04:01 AM
|
0 responses
2 views
0 likes
|
Last Post
![]()
by emapleq
Today, 04:01 AM
|
||
Started by varun12343, Today, 03:09 AM
|
1 response
4 views
0 likes
|
Last Post
|
||
Started by Lance El Camino, Yesterday, 04:14 PM
|
2 responses
21 views
0 likes
|
Last Post
![]()
by NT-Roland
Today, 02:40 AM
|
||
Started by MatthewLesko, Yesterday, 11:13 PM
|
1 response
12 views
0 likes
|
Last Post
![]()
by NT-Roland
Today, 02:23 AM
|
||
Started by kevinenergy, Today, 01:44 AM
|
0 responses
4 views
0 likes
|
Last Post
![]()
by kevinenergy
Today, 01:44 AM
|
Comment