Jim Dean![]() Sage ![]() ![]() Posts: 3022 Joined: 9/21/2006 Location: L'ville, GA ![]() | This requires OT Pro. Save code below as an OLang Indic and compile it. Manually create chart with the VHI indicator showing in a pane Add the OLang indicator aJDndVolMA to that same pane. ... note ... VHI is a special case ... normally you'd plot it from within the custom indicator, but it is a pain to recreate the color-shading of the VHI from within OLang, so I just took a shortcut here. #Indicator '*************************************************************************+ ' aJDndVolMA by Jim Dean, 14jan14 ' ' Plots VMA on the same scale as V (or VHI which = V) ' To see VHI colors, plot VHI manually on the same pane as this indicator '*************************************************************************+ #param "VMAperiods", 10 dim VolMA, Lo, Hi as double ' uses double to preserve precision VolMA = SMA(V,VMAperiods) ' uses Simple MA since not specified Lo = math.min(VolMA,V) Hi = math.max(VolMA,V) setscales(Lo,Hi) plot("VolMA", VolMA, orange) return VolMA |