View Full Version : SMA of Midpoint
nybangali
08-19-2007, 12:26 AM
I am trying to create an indicator that is the SMA of (H+L)/2
Do I need to modify the SMA source code and start from scratch, or is there a trick?
NinjaTrader_Dierk
08-19-2007, 03:46 AM
You should not modify the existing SMA, but create your own version by editing SMA, right clikc->Save as.
NinjaTrader_Ray
08-19-2007, 09:05 AM
Do you just want to plot this on a chart or use it in another indicator/strategy?
If on a chart, just add the system SMA indicator and set the price type property to "Median" which is (H+L)/2.
If you want to use it in another strategy/indicator, just call the method like:
SMA(Median, 20)[0]
This would be the value of the current bar 20 period SMA of Median prices.
nybangali
08-19-2007, 07:52 PM
Median it is. I read, and read (the documentation) and yet I miss the obvious.
Thanks guys
Do you just want to plot this on a chart or use it in another indicator/strategy?
If on a chart, just add the system SMA indicator and set the price type property to "Median" which is (H+L)/2.
If you want to use it in another strategy/indicator, just call the method like:
SMA(Median, 20)[0]
This would be the value of the current bar 20 period SMA of Median prices.
nybangali
08-20-2007, 01:22 AM
This is continuation of my previous dumb post. Though I think this question is harder.
I have an histogram oscillator which is SMA(Median, 5)[0] - SMA(Median, 34)[0]
I want to create a second histogram which is the above indicator MINUS the 5 period SMA of the above indicator. In other words the input is the above histogram, not any standard dataseries. Do I need to clone and modify the SMA formula ? I am also thinking brute force calculation in a function (since its an SMA).
Median it is. I read, and read (the documentation) and yet I miss the obvious.
Thanks guys
NinjaTrader_Josh
08-20-2007, 02:09 AM
Give this a try. I believe it should work.
Leave your current SMA(Median, 5)[0] - SMA(Median, 34)[0] indicator alone and program another indicator to get your second histogram. Lets say your current indicator is titled SMAMedian. To achieve what you want you would proceed with a new indicator in the same fashion as your current indicator and create a histogram with the calculation of SMAMedian[0] - SMA(SMAMedian, 5)[0].