Hello,
I am a french trader and user of amibroker( former TS user ) ,and I always have the same problems with array identifiers.
On TS, you simply use a variables between the brackets, but on ami, it seems like you have to put [barcount - var]...
Anyone can help me and tell where the error is in this code. It's a simple mov avg system referring to the past value of the mov avg:
Amount = Param( "dollz", 10000, 50, 1000000, 50 );
defMAL = Param("MAL", 10, 2, 200, 10 );
defR = Param( "Recul", 30, 2, 30, 2 );
MAL = Optimize( "MAL", defMAL, 2, 100, 5 );
R = Optimize( "Recul", defR, 1, 20, 2 );
PositionSize = Amount;
MyMA = MA( Close, MAL );
Buy = MyMA > MyMA[BarCount - R];
Sell = MyMA < MyMA[BarCount - R];
Short = MyMA < MyMA[BarCount - R];
Cover = MyMA > MyMA[BarCount - R];
Thanks for your help.
I am a french trader and user of amibroker( former TS user ) ,and I always have the same problems with array identifiers.
On TS, you simply use a variables between the brackets, but on ami, it seems like you have to put [barcount - var]...
Anyone can help me and tell where the error is in this code. It's a simple mov avg system referring to the past value of the mov avg:
Amount = Param( "dollz", 10000, 50, 1000000, 50 );
defMAL = Param("MAL", 10, 2, 200, 10 );
defR = Param( "Recul", 30, 2, 30, 2 );
MAL = Optimize( "MAL", defMAL, 2, 100, 5 );
R = Optimize( "Recul", defR, 1, 20, 2 );
PositionSize = Amount;
MyMA = MA( Close, MAL );
Buy = MyMA > MyMA[BarCount - R];
Sell = MyMA < MyMA[BarCount - R];
Short = MyMA < MyMA[BarCount - R];
Cover = MyMA > MyMA[BarCount - R];
Thanks for your help.