AFL coding help

#1
Hi All,

Could some one please help me with the following requirement.

I am experimenting with amibroker backtesting

I have the following example buy logic

SetOption("AllowSameBarExit", False );
Buy = MACD() > 0 AND RSI() > 30;


for the sell part I have the following requirement

SELL if the close price of the share is greater than the close price of the share at buy and if it is within 3 trading days of the buy.

I am not able to get the AFL code to get this logic

so basically I need SELL=???
 

mastermind007

Well-Known Member
#2
Sell = Close > ValueWhen(Buy, Close) AND Day() >= ValueWhen(Buy, Day()) + 3;
 

Similar threads