Hi,
I Want to Convert Following TradeStation Funtion into Amibroker But NOt
Able to get Same Result Can You Please tell Me Why It is Happeninig
Tradestation Code:
inputs:
PriceValue( numericseries ),
Len( numericsimple ) ;
variables:
var0( 0 ) ;
if CurrentBar = 1 then
begin
for Value1 = 0 to Len - 1
begin
var0 = var0 + PriceValue[Value1] ;
end ;
end
else
var0 = var0[1] + PriceValue - PriceValue[Len] ;
SummationOfValue = var0 ;
/////////////////////////////////////////////////////////////
Amibroker Code(Not Working):
function SummationOfValue( PriceValue, Len )
{
var0= 0;
Var2=Ref(PriceValue,-Len);
for (i=0;i<BarCount;i++)
{
if (i == 0 )
{
for (Value1 = 0; Value1<Len - 1;Value1++)
{
if(Value1==0)
{
var0[i] = PriceValue[Value1] ;
}
else
{
var0[i] = var0[i] + PriceValue[Value1] ;
}
}
}
else
{
var0[i] = var0[i-1] + (PriceValue[i] - Var2[i]);
}
}
return Var0;
}
//////////////////////////////////////////////////////////
Please Help Me In The Above Conversion As Soon as Possibe,
Thanks in Advance