Download MetaTrader 5

How can i get other symbol indicator value?

To add comments, please log in or register
Eck369
25
Eck369  

Hi, 

I am trying to get the Stochastic value from other Symbol like below but i got 0 value.

if(Symbol() == EURUSD) 

    double Env_USDJPY_Sto_Cur = iCustom("USDJPY",60,"Stochastic",K_Period,D_Period,Slowing,0,0);

}

 May some1 can gives some advice? thanks~

honest_knave
Moderator
2296
honest_knave  
Eck369:

Hi, 

I am trying to get the Stochastic value from other Symbol like below but i got 0 value.

if(Symbol() == EURUSD) 

    double Env_USDJPY_Sto_Cur = iCustom("USDJPY",60,"Stochastic",K_Period,D_Period,Slowing,0,0);

}

 May some1 can gives some advice? thanks~

No need to use iCustom for stochastic. Just use

iStochastic() - MT4

iStochastic() - MT5

iStochastic - Technical Indicators - MQL4 Reference
iStochastic - Technical Indicators - MQL4 Reference
  • docs.mql4.com
iStochastic - Technical Indicators - MQL4 Reference
Eck369
25
Eck369  
honest_knave:

No need to use iCustom for stochastic. Just use

iStochastic() - MT4

iStochastic() - MT5

Thanks for the reply :)

 However, i still got the 0 value --> Env_USDJPY_Sto_Cur = 0

 double Env_USDJPY_Sto_Cur = iStochastic("USDJPY",0,K_Period,D_Period,Slowing,MODE_SMA,0,MODE_MAIN,0);

 

if i change it to  

 double Env_USDJPY_Sto_Cur = iStochastic(Symbol(),0,K_Period,D_Period,Slowing,MODE_SMA,0,MODE_MAIN,0); 

 

i can get the value but the Symbol() is not i wanted.

 

Thanks. 

honest_knave
Moderator
2296
honest_knave  
Eck369:

Thanks for the reply :)

 However, i still got the 0 value --> Env_USDJPY_Sto_Cur = 0

 double Env_USDJPY_Sto_Cur = iStochastic("USDJPY",0,K_Period,D_Period,Slowing,MODE_SMA,0,MODE_MAIN,0);

 

if i change it to  

 double Env_USDJPY_Sto_Cur = iStochastic(Symbol(),0,K_Period,D_Period,Slowing,MODE_SMA,0,MODE_MAIN,0); 

 

i can get the value but the Symbol() is not i wanted.

 

Thanks. 

Things to check:

  • Do you have a suffix on your symbols? Like "USDJPYm" or "USDJPY-sb"
  • Have you had a USDJPY chart open? If not, it will take some time for data to be downloaded from your broker
Eck369
25
Eck369  
honest_knave:

Things to check:

  • Do you have a suffix on your symbols? Like "USDJPYm" or "USDJPY-sb"
  • Have you had a USDJPY chart open? If not, it will take some time for data to be downloaded from your broker

Hi,

 i have open the EURUSD Chart and drag my EA on it, my EA have below command but i still get the 0 value, only i use Symbol() instead of "EURUSD" just can get the value.

   double Env_USDJPY_Sto_Cur = iStochastic("EURUSD",0,K_Period,D_Period,Slowing,MODE_SMA,0,MODE_MAIN,0); 

honest_knave
Moderator
2296
honest_knave  

Please check my first point.

If you are unsure, post a screenshot of your chart.

Eck369
25
Eck369  
honest_knave:

Please check my first point.

If you are unsure, post a screenshot of your chart.

Hi,

 

i just put "EURUSD", attached is the print screen.

thanks. 

Files:
PrintScreen.png 380 kb
honest_knave
Moderator
2296
honest_knave  
Eck369:

Hi,

 

i just put "EURUSD", attached is the print screen.

thanks. 

You need to write EURUSD.sfx1

Eck369
25
Eck369  
honest_knave:

You need to write EURUSD.sfx1

Problem Solve :D 

Thanks a lot honest_knave !!!

To add comments, please log in or register