how to code this in afl

#1
Buy 2 points above the present candle high
Sell 2 points below the present candle low

if buy triggered SL 2 points below the Buy price
if sell triggered SL 2 points above the Sell price

If buy triggered Target 2 points above Buy Price
If sell triggered Target 2 points below Sell Price

Want this in parameters so that numbers can be changed
 

doss186

Well-Known Member
#2
2 points above or below the present candle may change any moment and the result will only give you repainting. So go for two bars above or two bars below to avoid repainting.
 
#3
Thank you for your post doss186 .. however I was looking for the code above for back test. I understand what you are recommending. I want the code to be as above plz help me code .... also want it in parameters so that the numbers can be changed with ease. and want only 1 trade buy or sell
 

Similar threads