Why one if works and the other don't? - page 2

 

Brilliant. No. In my former days as QA guy, I had two of your kind for breakfast. :D

I said global or static, didn't I?

And please don't make this a lengthy EA development thread. Stick to a precise problem description, name it in the topic so that others may be able to look it up laters.

 
lippmaje:

Brilliant. No. In my former days as QA guy, I had two of your kind for breakfast. :D

I said global or static, didn't I?

And please don't make this a lengthy EA development thread. Stick to a precise problem description, name it in the topic so that others may be able to look it up laters.

I'm really confused. Can you show me where to put it? My robot doesn't do nothing right now. I don't know Why.
 
      //creating an array for several prices
      double myRSIArray[];
      
      //sorting the price array from the current candle downwards
      ArraySetAsSeries(myRSIArray,true);
      
      //defined EA, current candle, 3 candles, store result
      CopyBuffer(myRSIDefinition, 0, 0, 3, myRSIArray);
      
      //retrieving RSI for the current candle
      double currRSIValue = myRSIArray[0];         

      //retrieving RSI for the previous candle
      double prevRSIValue = myRSIArray[1];         

It's up to you to study and understand how to use global and static variables.

For now let's fill prev RSI from the buffer, that is the RSI value of the previous candle

This should suffice to implement an upcross/downcross check

The other problem, why you started this topic, is to get your if statements right. You already had some directions. Once you got the cross checks done, reflect over it.

 
lippmaje:

It's up to you to study and understand how to use global and static variables.

For now let's fill prev RSI from the buffer, that is the RSI value of the previous candle

This should suffice to implement an upcross/downcross check

The other problem, why you started this topic, is to get your if statements right. You already had some directions. Once you got the cross checks done, reflect over it.

Thank you. I solved that problem and now I got one more. I'm sorry for this, but this is so confusing. Is there a reason why using the last tick and the previous RSI tick value only works on the 1-minute chart and not on the 5 minutes one? Because that's exactly what's happening right now. You are being kind and I'm here confused. Thank you a lot. 
 
15112020:
Thank you. I solved that problem and now I got one more. I'm sorry for this, but this is so confusing. Is there a reason why using the last tick and the previous RSI tick value only works on the 1-minute chart and not on the 5 minutes one? Because that's exactly what's happening right now. You are being kind and I'm here confused. Thank you a lot. 

Good. For the new issue I suggest to open it on a separate thread and leave this here for comments related to the topic. -

Reason: