Hope someone can help me. My programming skills are under development.
I think I got most of if right but I would like to have the result
logaritmic. The compilation goes ok but then in the indicator it says
logaritm error.
Thanks in advance Stefan
Code: Select all
//Interpreted from www.emini-watch.com,
//http://emini-watch.com/free-stuff/trin-index-arms-index/
inputs:
Advn_NY( Close Data2 ), { {Adv_Issues_NY} }
Decl_NY( Close Data3 ), { Dec_Issues__NY}
Advn_Q( Close Data4 ), { {Adv_Issues_Q} }
Decl_Q( Close Data5 ), { Dec_Issues_Q }
UpVol_NY( Close Data6 ), { Adv_V_NY }
DnVol_NY( Close Data7 ), { Dec_V_NY }
UpVol_Q( Close Data8 ), { Adv_V_Q }
DnVol_Q( Close Data9 ) ; { Dec_V_Q }
variables:
IssRatio( 0 ),
VolRatio( 0 ),
Trin( 0 ),
Trinlog( 0 );
if Advn_NY <> 0 then
IssRatio = ((Advn_NY+Advn_Q) / (Decl_NY+ Decl_Q ));
if Upvol_NY <> 0 then
VolRatio = ((Upvol_NY+UpVol_Q) / (DnVol_NY+ DnVol_Q ));
Trin = ( IssRatio / VolRatio );
TrinLog = (log(Trin));
//Plot1( Trin, "Trin" ) ;
Plot1( Trinlog, "Trin" ) ;
Plot2( 0, "Zero" ) ;
Plot2( 100, "OB" ) ;
Plot2( -100, "OS" ) ;