stop loss condition

 

Good morning everyone,

I would like to ask you for a little help, I am planning an ea but I miss the last piece, in this period I have had several problems and I have not been able to study how to solve this question of mine.

what I would like to do is the following:


the stop loss must develop as much as for the buy: the rsi indicator is less than the value 50 but previously the si has been> than the value 65.

                                                          for the sell: the rsi indicator is greater than the value 50 but previously the si was <the value 35.


I hope someone can easily help me.

 

Are you sure it is really little?

What do you mean with " si "?

 
Do you mean the previous bar rsi?
Get informed on how to make an MA crossover, then you know basically how to do this.