Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Developing Indicator to use in MA
Collapse
X
-
Developing Indicator to use in MA
I want to develop an alert when the last price is within 10 cents of the 200 day SMA, but that's not possible in MA. Is it possible to develop an indicator that will tell me the distance (in cents) that the price is from the 200 SMA that I can then develop an alert from? If so, any help with the code?Last edited by mavrik2747; 06-15-2011, 04:31 AM.Tags: None
-
Welcome to our forums - I believe you could start for example with a MACD set to 1, 200, 1 as settings, so in essense you just see the difference of price vs the EMA used. For your version using a SMA the code would need to be changed / modified then. We have some great tutorials on getting started in custom coding:
-
Not sure if this is right or not, but here's what I've come up with for the code line from going through previous posts...
(Math.Abs(Close[0] - SMA(200)[0]) < .1)
or
(Math.Abs(Close[0] - SMA(200)[0])=[0])
Would the first one work for when to identify when the price is within 10 cents and the second one work for the absolute value of whatever the difference is?
For alerts, I'm assuming I could set up a true/false alert for the first line and actual value alert for the second.
Am I getting close or am I completely off?
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Hwop38, 05-04-2026, 07:02 PM
|
0 responses
164 views
0 likes
|
Last Post
by Hwop38
05-04-2026, 07:02 PM
|
||
|
Started by CaptainJack, 04-24-2026, 11:07 PM
|
0 responses
317 views
0 likes
|
Last Post
by CaptainJack
04-24-2026, 11:07 PM
|
||
|
Started by Mindset, 04-21-2026, 06:46 AM
|
0 responses
245 views
0 likes
|
Last Post
by Mindset
04-21-2026, 06:46 AM
|
||
|
Started by M4ndoo, 04-20-2026, 05:21 PM
|
0 responses
350 views
0 likes
|
Last Post
by M4ndoo
04-20-2026, 05:21 PM
|
||
|
Started by M4ndoo, 04-19-2026, 05:54 PM
|
0 responses
179 views
0 likes
|
Last Post
by M4ndoo
04-19-2026, 05:54 PM
|

Comment