PureBytes Links
Trading Reference Links
|
Hello,
First:
if you write buy=1 you ASSIGN 1 to buy variable.
To check if it is equal you have to use double = operator:
buy == 1
but it is not necessary because AFL works in a way
similar to C/C++: zero value are treated as "false" and
non-zero values are treated as "true", so you can write:
sell = barssince(buy)>5; // sell after 5 bars from the last buy signal
For repeating buy signals it is better to use
sell = ref( buy, -5 ); // sell after 5 bars from the initial buy signal
Best regards,
Tomasz Janeczko
===============
AmiBroker - the comprehensive share manager.
http://www.amibroker.com
----- Original Message -----
From: <bmx888@xxxx>
To: <amibroker@xxxxxxxxxxxxxxx>
Sent: Saturday, November 10, 2001 6:17 PM
Subject: [amibroker] count bars since entry
> I use the following to count bars since entry and it did not work.
> Is there any function in AFL that refers to position?
>
> sell=barssince(buy=1)>5;
>
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>
|