fRIENDS
I saw code for trade station named chick goslin trigger line
Can any kind person convert it to code for amibroker?please
---------------------------------
code for ts
------------------------------
{ Chick Goslin Trigger Line
www.tradestationworld.com/discussions/Topic.aspx?Topic_ID=25839}
inputs: Price( Close ), Length1( 3 ),Length2( 10 ),LengthAll( 16 ),
Displace( 0 ) ;
variables: AvgOne(0), AvgTwo(0);
if Displace >= 0 or CurrentBar > AbsValue( Displace ) then
begin
AvgOne=AverageFC( Price, Length1 );
AvgTwo=AverageFC( Price, Length2 );
Plot1[Displace]( AverageFC( AvgOne-AvgTwo, LengthAll ), "ML" ,
yellow, default) ;
Plot2[Displace] ((AvgOne-AvgTwo), "SL", red,default ) ;
Plot3(0, "Zero", white, default);
end ;
{ AverageFC: Returns simple average of values over Length bars
(fastcalc) }
inputs:
Price( numericseries ),
Length( numericsimple ) ; { this input is assumed to be a
constant >= 1; will get
divide-by-zero error if Length = 0 }
AverageFC = SummationFC( Price, Length ) / Length ;
{ Summation FC: Returns the summation of values over Length bars
(fast calc) }
{ Summation, fast calculation (series function) }
inputs:
Price( numericseries ),
Length( numericsimple ) ; { this input is assumed to be
constant }
variables:
Sum( 0 ) ;
if CurrentBar = 1 then
begin
for Value1 = 0 to Length - 1
begin
Sum = Sum + Price[Value1] ;
end ;
end
else
Sum = Sum[1] + Price - Price[Length] ;
SummationFC = Sum ;
-------------------------------------------------
Many thanks in advance.