RSI/Price correspondence

 

Hi,
I am trying to get the price the last time the RSI equaled a specific reading anyone know if there is an array storing the price at that reading?

For example I can use my own variable and say when 1 hour rsi=50, myvar=current price but if the app or computer gets turned off you lose those values. I want the price from the last time the 1h rsi equaled 50.

Thanks

 
Bodhi Mantra:

Hi,
I am trying to get the price the last time the RSI equaled a specific reading anyone know if there is an array storing the price at that reading?

For example I can use my own variable and say when 1 hour rsi=50, myvar=current price but if the app or computer gets turned off you lose those values. I want the price from the last time the 1h rsi equaled 50.

Thanks


Read up on Global Variables, then check out "GlobalVariableSet" and GlobalVariableGet


https://www.mql5.com/en/docs/globals
Global Variables of the Terminal - MQL4 Reference
Global Variables of the Terminal - MQL4 Reference
  • docs.mql4.com
Global Variables of the Terminal - MQL4 Reference
 
Alexander Martinez #:


Read up on Global Variables, then check out "GlobalVariableSet" and GlobalVariableGet


https://www.mql5.com/en/docs/globals

Interesting, thanks mate

 
Bodhi Mantra:

Hi,
I am trying to get the price the last time the RSI equaled a specific reading anyone know if there is an array storing the price at that reading?

For example I can use my own variable and say when 1 hour rsi=50, myvar=current price but if the app or computer gets turned off you lose those values. I want the price from the last time the 1h rsi equaled 50.

Thanks

You can try saving the data to a local file and remember save the file periodically.

 
Bodhi Mantra #:

Interesting, thanks mate

No problem!

calvados_zju #:

You can try saving the data to a local file and remember save the file periodically.

That's essentially what a Global Variable does, except the entire process is abstracted.
 
Alexander Martinez #:

No problem!

That's essentially what a Global Variable does, except the entire process is abstracted.

Yah it is working great thanks Alex. I wanted to add to this thread for anyone who may read it later that if you run the bot in the tester app with the same global variable names you can get the back data and have those past values stored in your vars for your live bot to use as well. 

 
calvados_zju #:

You can try saving the data to a local file and remember save the file periodically.

Yah thanks Carlos. I was actually going to do this if there were no better suggestions. It is really annoying working with parsing flat files however so I thought I would just put the question out there and see if someone like Alex would suggest something easier/less work. :)