Bangkok
Posts: 5 since Feb 2015
Thanks Given: 1
Thanks Received: 0
|
Can anyone point me in the right direction regarding Easylanguage? I would like to have the Tradestation Momentum indicator reference volume instead of price. I have replaced "Mom = Momentum( Price, Length )" with "Mom = Momentum( Volume, Length )" (in red text) but when I do this the indicator appears very different on the screen and therefore no good. With this in mind I guess there is more to it? The code is below. Any pointers on this would be appreciated.
Thanks
variables:
intrabarpersist InAChart( false ),
Mom( 0 ),
Accel( 0 ),
ColorLevel( 0 ) ;
once
begin
InAChart = GetAppInfo( aiApplicationType ) = cChart ;
end ;
Mom = Momentum( Volume, Length ) ;
Accel = Momentum( Mom, 1 ) ; { 1 bar acceleration }
Plot1( Mom, !( "Momentum" ) ) ;
Plot2( 0, !( "ZeroLine" ) ) ;
{ gradient coloring }
if UseGradientColoring then
begin
ColorLevel = NormGradientColor( Mom, true, ColorNormLength, UpColor, DnColor ) ;
if InAChart then { study is applied to a chart }
SetPlotColor( 1, ColorLevel )
else { study is applied to grid app }
begin
SetPlotColor( 1, GridForegroundColor ) ;
SetPlotBGColor( 1, ColorLevel ) ;
end ;
end ;
{ alert criteria }
if AlertEnabled then
begin
if Mom > 0 and Accel > 0 then
Alert( !( "Indicator positive and increasing" ) )
else if Mom < 0 and Accel < 0 then
Alert( !( "Indicator negative and decreasing" ) ) ;
end
|