Does the code below works fine with Gold (XAUUSD) ?

To add comments, please log in or register
Mohammed Abdulwadud Soubra
32255
Mohammed Abdulwadud Soubra  

Hello, 

One question please.

Does the code below works fine with Gold (XAUUSD) ?


double MyPoint = Point;
//+------------------------------------------------------------------+
//| Expert initialization function
//+------------------------------------------------------------------+
int OnInit() {    if(Digits == 3 || Digits == 5) MyPoint = Point * 10; //---    return(INIT_SUCCEEDED); }

 

 

Thanks for all 

Marco vd Heijden
Moderator
13040
Marco vd Heijden  
Mohammad Soubra:

Hello, 

One question please.

Does the code below works fine with Gold (XAUUSD) ?

 

 

Thanks for all 

Print("GOLD: ",DoubleToString(Digits()));


Maybe it does nothing if it's neither 3 or 5

Mohammed Abdulwadud Soubra
32255
Mohammed Abdulwadud Soubra  
Marco vd Heijden:


Maybe it does nothing if it's neither 3 or 5

So, the gold is 2 digits ...

Then, what to use, Point * 1 only ??? 

Ernst Van Der Merwe
7169
Ernst Van Der Merwe  
Mohammad Soubra:

So, the gold is 2 digits ...

Then, what to use, Point * 1 only ??? 

if(_Symbol == "XAUUSD") MyPoint = Point * 10;
Mohammed Abdulwadud Soubra
32255
Mohammed Abdulwadud Soubra  
Ernst Van Der Merwe:
Oh... thanks mate
Great

But does it work with any broker?
Ernst Van Der Merwe
7169
Ernst Van Der Merwe  
Mohammad Soubra:
Oh... thanks mate
Great

But does it work with any broker?

Most brokers have 2 digit Gold prices, but to be sure:

if(_Symbol == "XAUUSD" && Digits == 2) MyPoint = Point * 10;
Mohammed Abdulwadud Soubra
32255
Mohammed Abdulwadud Soubra  
Ernst Van Der Merwe:

Most brokers have 2 digit Gold prices, but to be sure:

Thanks for your repeat
Same what I am using you have repeated
But thanks a lot


Mohammed Abdulwadud Soubra
32255
Mohammed Abdulwadud Soubra  
What about S&P500 or NasDaq or .... bla bla bla
Any body has good idea?
To add comments, please log in or register