[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [amibroker] Help on some code



PureBytes Links

Trading Reference Links

try this
price=(h+l)/2;
denum=sum(price,10);
num1=price;
num2=num1+2*ref(price,-1);
num3=num2+3*ref(price,-2);
num4=num3+4*ref(price,-3);
num5=num4+5*ref(price,-4);
num6=num5+6*ref(price,-5);
num7=num6+7*ref(price,-6);
num8=num7+8*ref(price,-7);
num9=num8+9*ref(price,-8);
num10=num9+10*ref(price,-9);
cg0=-num10/denum;
graph0=cg0;
graph1=ref(cg0,-1);

ERKAN
--- gnader_2000 <zepplin@xxxx> wrote:
> Need help with this code. This is some code from
> Trade Station which 
> creates two moving averages. I'd like to create
> these in AB as a 
> indicator to see what kind of trades would have been
> generated using 
> the cross over on the resulting plots. Any help
> would be appreciated. 
> Thanks in advance.
> 
> 
> P1 = (H + L)/2;
> L1 = 10;
> 
> Num = 0;
> Count = 0;
> Denon = 0;
> CG = 0;
> 
> For Count = 0 to L1 -1 begin
> Num = Num + (1 + Count)*P1[Count]);
> Denom = Denom + (P1[Count]);
> End;
> 
> IIf (Denom <> 0,CG = -Num/Denom,);
> 
> Plot(CG,"CG");
> Plot(CG[1],"CG1");
> 
> 
> 
> George
> 
> 
> 


__________________________________________________
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/