Matthew Greenslet![]() Idol ![]() ![]() ![]() ![]() Posts: 2077 Joined: 2/27/2006 ![]() | If you are changing the SMA the only line you need to change is fSMA = Sum(Periods)/Periods More specifically the Sum function. Just like with most other function calls it uses the close price as the default value. As pointed out in the FAQ I mentioned earlier most function calls have an 'overload' or a second way to call it. This overload will allow you to specify the values to use for the calculations. So you could change it to fSMA = Sum(H, Periods)/Periods or fSMA = Sum(L, Periods)/Periods or fSMA = Sum(O, Periods)/Periods If you wanted to make it fancy you could add a parameter that allows you to dynamically choose the value. #Indicator #PARAM "Periods", 14 #PARAM "PriceField", 2, 1, 4 Dim fPrice, fSMA as Single If PriceField = 1 Then fPrice = O ElseIf PriceField = 2 Then fPrice = H ElseIf PriceField = 3 Then fPrice = L ElseIf PriceField = 4 Then fPrice = C End If fSMA = Sum(fPrice, Periods)/Periods PlotPrice("SMA", fSMA) Return fSMA |