Can anyone help me to convert this simple Volume UPDN from Tradestation into
TOS. It shows volume Difference and Ratio. This is mostly for intraday charting.
/////////////////////////////////////////////////////////////////////
//Volume UPDN
{ Plots the difference or ratio (user choice) of the cumulative up and down volume
for the day so far. For use with "live" market data only (the server fields used in
this indicator do not have stored history so will not be plotted on historical
bars). }
inputs:
DiffOrRatio_1or2( 1 ) ; // set to 1 for Up-Dn difference, 2 for Up/Dn ratio
variables:
UpDivDn( 1 ),
UpMinusDn( 0 ) ;
if GetAppInfo( aiRealTimeCalc ) = 1 then { real-time tick - not on bar in history }
begin
if DiffOrRatio_1or2 = 1 then
begin
UpMinusDn = DailyVolumeUp - DailyVolumeDn ;
Plot1( UpMinusDn, "UpDn" ) ;
//Plot2( 0, "Baseline" ) ;
If Plot1 > 0 then setplotcolor(1,green);
end
else if DiffOrRatio_1or2 = 2 then
begin
if DailyVolumeDn <> 0 then
UpDivDn = DailyVolumeUp / DailyVolumeDn ;
Plot1( UpDivDn, "UpDn" ) ;
//Plot2( 1, "Baseline" ) ;
if plot1 < 0 then setplotcolor(1,red);
end
else
RaiseRunTimeError( "DiffOrRatio_1or2 input must be 1 or 2." ) ;
end ;
////////////////////////////////////////////////////////////////////////////////
Thank you