#Run_By_Bar
INPUT: NUM(10), avglen(5), thold(10);
Value1 = H - lowest ( H , 60 ) ;
Value2 = L - highest ( L , 60 ) ;
Value9 =average( Maxlist(0,value1),avglen);
Value10 =average( Minlist(0,value2),avglen);
Value11 = (value9 + value10) * Sqrt(num) ;
plot1(value11,'ax');
value12 = average(value11[1],2);
if value11 < 0 then begin
plot2(-thold,'di-');
If Value11 < Value12 then Plot4(0,'TrendStart');
end;
if value11 > 0 then begin
plot3( thold,'di+');
If Value11 > Value12 then Plot4(0,'TrendStart') ;
end;