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

Re: [amibroker] USE OF [ ]



PureBytes Links

Trading Reference Links

Hello,

No, in AMiBRoker you should use Ref function
http://www.amibroker.com/f?Ref


Buy = MyMA > Ref( MyMA, - R);

[ ] - operator is for accessing individual array ELEMENTS.

Must-read for everyone:
http://www.amibroker.com/guide/h_understandafl.html


Best regards,
Tomasz Janeczko
amibroker.com
  ----- Original Message ----- 
  From: Schippers Anthony 
  To: amibroker@xxxxxxxxxxxxxxx 
  Sent: Tuesday, October 17, 2006 7:54 PM
  Subject: [amibroker] USE OF [ ]


  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.



------------------------------------------------------------------------------
  Yahoo! Mail réinvente le mail ! Découvrez le nouveau Yahoo! Mail et son interface révolutionnaire.  
Content-Description: "AVG certification"
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.409 / Virus Database: 268.13.27/517 - Release Date: 11/3/2006