Struggling with my first AFL code

#1
Dear experts,

I learned a basics of AFL coding and now I am trying to do some backtesting using following strategy:

Buy at RSI(7) <= 30
Sell when price is greater than last bought price + 1 rs or if that condition is not met sell at next RSI(7) >= 70

I could do simple AFL backtesting described in tutorials but how to code this I am not able to visualize.

I request experts to give some direction.

Thanks in advance :clap::clap::clap:
 
#2
I figured out myself,

From backtester settings -> Stops -> Profit target

Set enable and check point, give some value and select dropdown box "Exit intraday at stop".

Then it will ignore sell price if target is met.

Thought it would have been nice to to have that feature from code also.
 

Similar threads