Trying to get option strike - MQL5

 

Hey, I'm creating an EA and to get it working I need to get the strike value of an option. I'm using the function SymbolInfoDouble ("Option", SYMBOL_OPTION_STRIKE); but its always returning zero...

 I found that function here: https://www.mql5.com/en/docs/constants/environment_state/marketinfoconstants

Does anyone know why this is happening?

Thanks 

Documentation on MQL5: Standard Constants, Enumerations and Structures / Environment State / Symbol Properties
Documentation on MQL5: Standard Constants, Enumerations and Structures / Environment State / Symbol Properties
  • www.mql5.com
Standard Constants, Enumerations and Structures / Environment State / Symbol Properties - Reference on algorithmic/automated trading language for MetaTrader 5
 
from where you try to get information about the options? options presently disabled in the terminal
 
ivanivan_11:
from where you try to get information about the options? options presently disabled in the terminal

Thanks for your reply but what do you mean by options presently disabled in the terminal? I'm trying to get the strike from my EA by writing that code that I sent in the question (SYMBOL_OPTION_STRIKE), I can't get it by hand because I need to get the strike from like 100 options, so I need my EA to do this for me.

 

Thanks!

 
lucas_heise:

Thanks for your reply but what do you mean by options presently disabled in the terminal? I'm trying to get the strike from my EA by writing that code that I sent in the question (SYMBOL_OPTION_STRIKE), I can't get it by hand because I need to get the strike from like 100 options, so I need my EA to do this for me.

 

Thanks!

Check for an error code. If it returns 0 it's most probably not available.

Which brokers/server and option are using ?

 
lucas_heise:

Thanks for your reply but what do you mean by options presently disabled in the terminal? I'm trying to get the strike from my EA by writing that code that I sent in the question (SYMBOL_OPTION_STRIKE), I can't get it by hand because I need to get the strike from like 100 options, so I need my EA to do this for me.

 

Thanks!

Yes, Which broker do you use?
 
ivanivan_11:
Yes, Which broker do you use?

I'm using a brazillian one (XP Pro), I'm from Brazil btw.

Thanks 

 
Alain Verleyen:

Check for an error code. If it returns 0 it's most probably not available.

Which brokers/server and option are using ?

I'm using a brazillian one (XP Pro), I'm from Brazil btw.

Thanks for your reply

 

Thanks everyone for the replies but I found a way around it, I'm passing all the strikes from excel to a .txt file and reading it on my EA.

Thanks again!! 

Reason: