Questions from Beginners MQL5 MT5 MetaTrader 5 - page 332

 

Can you please tell me if the formulas for calculating the cost of 1 point for 1 lot are correct?

EURUSD 0.0001*100000
GBPUSD 0.0001*100000
AUDUSD 0.0001*100000
NZDUSD 0.0001*100000
USDCAD 0.0001*100000/USDCAD
USDCHF 0.0001*100000/USDCHF
USDJPY 0.01*100000/USDJPY
EURGBP 0.0001*100000*EURUSD/EURGBP
EURAUD 0.0001*100000*EURUSD/EURAUD
EURNZD 0.0001*100000*EURUSD/EURNZD
EURCAD 0.0001*100000*EURUSD/EURCAD
EURCHF 0.0001*100000*EURUSD/EURCHF
EURJPY 0.01*100000*EURUSD/EURJPY
GBPAUD 0.0001*100000*GBPUSD/GBPAUD
GBPNZD 0.0001*100000*GBPUSD/GBPNZD
GBPCAD 0.0001*100000*GBPUSD/GBPCAD
GBPCHF 0.0001*100000*GBPUSD/GBPCHF
GBPJPY 0.01*100000*GBPUSD/GBPJPY
AUDNZD 0.0001*100000*AUDUSD/AUDNZD
AUDCAD 0.0001*100000*AUDUSD/AUDCAD
AUDCHF 0.0001*100000*AUDUSD/AUDCHF
AUDJPY 0.01*100000*AUDUSD/AUDJPY
NZDCAD 0.0001*100000*NZDUSD/NZDCAD
NZDCHF 0.0001*100000*NZDUSD/NZDCHF
NZDJPY 0.01*100000*NZDUSD/NZDJPY
CADCHF 0.0001*100000*USDCAD*CADCHF
CADJPY 0.01*100000*USDCAD/CADJPY
CHFJPY 0.01*100000*USDCHF/CHFJPY

Thank you in advance for the answer!

p.s. especially interested in the correctness of the last 3 formulas!

 

Here is a very interesting question:


There is a need to prohibit the EA from working on metals.

Of course, we can go "straightforwardly" list all possible metal symbols. Or at least set the search for a substring in the string of symbols... But I am interested if there is a nice way out, original short code for determining which group the symbol belongs to. Or something else interesting.

Please advise if someone already encountered with this question and know the solution.
 
artmedia70:

Here is a very interesting question:


There is a need to prohibit the EA from working on metals.

Of course, we can go "straightforwardly" list all possible metal symbols. Or at least set the search for a substring in the string of symbols... But I am interested if there is a nice way out, original short code for determining which group the symbol belongs to. Or something else interesting.

Please advise if anyone has already encountered this problem and knows the solution.

Here is an example:

   string path=SymbolInfoString(Symbol(),SYMBOL_PATH);
   if(StringFind(path,"Metals",0)>-1)
     Print("Символ "+Symbol()+" относится к группе металлов.");
 
NEED HELP!!!!
Why is there no signals tab in MT4 in the terminal and settings?Where is the signals tab?
 
akaMaxMan:
NEED HELP!!!!
Why is there no signals tab in MT4 in the terminal and in the settings?

Because your dealer has disabled this tab! It's best to ask your dealer about it.

Another option is to open your account in the terminal from another dealer.

 
tol64:

Here's an example:

Beautiful, thank you.

And why didn't I see it when I was digging through the documentation? )))

 
AlexeyVik:

It's beautiful, thank you.

And why didn't I see it when I was digging through the documentation? )))

It happens.)

Duplicated the answer to your thread.

 

Some tips for MQL5 beginners!!!

I don't understand why the compiler gives error 'starttime' - declaration without type:

datetime starttime=D'00:00:01';

datetime endtime=D'23:59:59';

MqlDateTime startday,swapday,endday;

void TimeToStruct(starttime,endday);

void TimeToStruct(endtime,endday);

startday.day_of_week=1;

swapday.day_of_week=3;

endday.day_of_week=5;

Документация по MQL5: Стандартные константы, перечисления и структуры / Структуры данных / Структура даты
Документация по MQL5: Стандартные константы, перечисления и структуры / Структуры данных / Структура даты
  • www.mql5.com
Стандартные константы, перечисления и структуры / Структуры данных / Структура даты - справочник по языку алгоритмического/автоматического трейдинга для MetaTrader 5
 
loaderinbox:
You have already been given your answer. And you don't need to knock on every thread.
 
Novikov:

Could you please tell me if the formulas to calculate the pip value for 1 lot are correct?

EURUSD 0.0001*100000
GBPUSD 0.0001*100000
AUDUSD 0.0001*100000
NZDUSD 0.0001*100000
USDCAD 0.0001*100000/USDCAD
USDCHF 0.0001*100000/USDCHF
USDJPY 0.01*100000/USDJPY
EURGBP 0.0001*100000*EURUSD/EURGBP
EURAUD0.0001*100000*EURUSD/EURAUD
EURNZD 0.0001*100000*EURUSD/EURNZD
EURCAD 0.0001*100000*EURUSD/EURCAD
EURCHF0.0001*100000*EURUSD/EURCHF
EURJPY 0.01*100000*EURUSD/EURJPY
GBPAUD 0.0001*100000*GBPUSD/GBPAUD
GBPNZD 0.0001*100000*GBPUSD/GBPNZD
GBPCAD 0.0001*100000*GBPUSD/GBPCAD
GBPCHF 0.0001*100000*GBPUSD/GBPCHF
GBPJPY 0.01*100000*GBPUSD/GBPJPY
AUDNZD0.0001*100000*AUDUSD/AUDNZD
AUDCAD 0.0001*100000*AUDUSD/AUDCAD
AUDCHF 0.0001*100000*AUDUSD/AUDCHF
AUDJPY0.01*100000*AUDUSD/AUDJPY
NZDCAD 0.0001*100000*NZDUSD/NZDCAD
NZDCHF 0.0001*100000*NZDUSD/NZDCHF
NZDJPY 0.01*100000*NZDUSD/NZDJPY
CADCHF 0.0001*100000*USDCAD*CADCHF
CADJPY 0.01*100000*USDCAD/CADJPY
CHFJPY 0.01*100000*USDCHF/CHFJPY

For your reply, thank you in advance!

p.s. especially interested in the fidelity of the last 3 formulas!

Dear transcendreamer gave me a detailed answer! Maybe someone will need it:

calculation is correct only for cadchf it should be 0.0001*100000/USDCAD/CADCHF
but in general there is a simple way - I will describe how I do it:
it's simplistic, but it works everywhere
look at the essence of the instrument, any instrument has a basis and a gauge
basis = what we trade = for cadchf it is the Canadian dollar= so we trade cad
gauge = what we quote basis = in this case the franc
so initially the financial result of any transaction will be in francs
so you have to convert the francs into the currency of the deposit(usd)
so we take usdchf - this is how many francs this is how many francs for 1 dollar
and we need the opposite - how many dollars for 1 franc
i.e. flip 1/x where x=usdchf
then as a result for the 4-digit point value we get 10 / usdchf = 10. 37
this can be done with any instrument knowing its quoted currency
Документация по MQL5: Стандартные константы, перечисления и структуры / Состояние окружения / Информация о счете
Документация по MQL5: Стандартные константы, перечисления и структуры / Состояние окружения / Информация о счете
  • www.mql5.com
Стандартные константы, перечисления и структуры / Состояние окружения / Информация о счете - справочник по языку алгоритмического/автоматического трейдинга для MetaTrader 5
Reason: