Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Distance from an EMA
Collapse
X
-
Distance from an EMA
Is there some way to quantify how far price is away from an EMA? or some way to running percent of deviation from some indicator's midline? Example: to see that price is x percent of deviation away from the mid line... (this would be used as a number to establish a no-trade area..."no trades unless price is x amount away from mid line"...(used as a reversion setup.)Tags: None
-
-
I have the VWAP8 free indicator. It does not seem to offer a way to measure the distance. Does the Ninja premium version off that?
Comment
-
Hello StevenNelson,
You can do what you are asking by using simple math in an indicator, I am otherwise not aware of a specific indicator that has both of these calculations as you specified.
If you wanted to know how far a price is away from the close or the difference you can subtract one number from the other to get a difference. The Close[0] - emaValue would result in the difference in prices.
If you needed to make that into a percent you could do that as well by converting the result to a whole value or decimal number depending on what scale you wanted it to be in. The mid line being used would just require that you use its value in your calculation. You can find many examples of calculating percent change in C# or doing other percent related operations by searching online, here is a public stackoverflow post that has one way to accomplish that task: https://stackoverflow.com/a/26533363
I look forward to being of further assistance.
JesseNinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Change colour of Stop market and limit orders to red and green via indicator script
by Rapine Heihei
Started by Rapine Heihei, 04-23-2024, 07:51 PM
|
2 responses
30 views
0 likes
|
Last Post
by Max238
Today, 02:25 AM
|
||
Started by Shansen, 08-30-2019, 10:18 PM
|
24 responses
943 views
0 likes
|
Last Post
by spwizard
Today, 01:29 AM
|
||
Started by Max238, Today, 01:28 AM
|
0 responses
9 views
0 likes
|
Last Post
by Max238
Today, 01:28 AM
|
||
Started by rocketman7, Today, 01:00 AM
|
0 responses
4 views
0 likes
|
Last Post
by rocketman7
Today, 01:00 AM
|
||
Started by wzgy0920, 04-20-2024, 06:09 PM
|
2 responses
28 views
0 likes
|
Last Post
by wzgy0920
Yesterday, 10:43 PM
|
Comment