problem with AFL code for Amibroker

#1
hi all,
I have a problem with AFL code for Amibroker:
I made a buy signal: Buy=Cross(MACD(8,17),Signal(8,17,9))
I need to make a profit stop at 20% above Buy and 10% below Buy,
Please help me to write AFL code for this.
i will use it in back testing and my custom indicator.

thank you in advance for your help.
gw
 
#2
In Automatic analysis window on Stops tab use profit target and sl fileds to specify ur criteria. If u need to plot your criteria, some guidelines - Use valuewhen() function to get the rate at which ur buy signal triggred. But you have to remove redundant signals with exrem() function. May be i can help u later, sorry, now not enough time.
 

Similar threads