Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 1375

 

Igor, thank you. Tried it. When I try to enter " or"/ into one of these functions, the variable two_pair starts to be a text, not a variable. And I need the " character to be inserted into the string, which is contained in the variable. So this option is not suitable.

 
Michail_David:

If I understand correctly, the currency pair should be specified as "EURUSD" in any indicator. In this regard, my question is


How can I insert the symbol " in string? Because the currency pair is printed in the journal as USDJPY, not "USDJPY".

https://www.mql5.com/ru/docs/strings

Currency pair is a string. No one cares how you put it together. The important thing is that this "pair" of yours is in the market overview.

Документация по MQL5: Строковые функции
Документация по MQL5: Строковые функции
  • www.mql5.com
Строковые функции - Справочник MQL5 - Справочник по языку алгоритмического/автоматического трейдинга для MetaTrader 5
 
Andrey Sokolov:

It's not clear, but okay.

They write that this is available onthe MICEX (FORTS), and Alpari also said that they have it on competitive accounts.

Perhaps with the expressions "only", "always". "never", "no one but" and the like need to be more careful.

Can you tell me if there is a situation in a regular trading account where the broker has closedopen positions and reopened them?

I have only seen it once in forex companies, a long time ago, and that was at Rumus.

 
Michail_David:

Igor, thank you. Tried it. When trying to enter " or "/" in one of these functions, the variable two_pair starts being a text, not a variable. And I need the " character to be inserted into the string, which is contained in the variable. So this variant won't work.

Write it this way:

string s = ""\" + "EURUSD" + ""\";

work it out, then remove the quotes for""\", then try the same manipulations for the variable containing the "EURUSD" value


but the point is the same - to get the quotes you need to use special characters

 
Michail_David:

If I understand correctly, the currency pair should be specified as "EURUSD" in any indicator. In this regard, my question is


How can I insert the symbol " in string? Since the currency pair is printed in the journal as USDJPY, not "USDJPY".

There are a lot of suggestions, but none of them are correct.

Why do you need inverted commas? Just use this.

string two_pair = Major_pair + Currency;

two_pair will be "USDJPY", that's exactly what should be used in the function parameters.

 
Alexey Viktorov:

There's a lot of advice and none of it's right.

Why do you need inverted commas? This is enough.

two_pair would be "USDJPY", exactly what should be used in function parameters.

I think there's another problem here - most likely an attempt to "do it for me" rather than learn how to solve your problem

 
Igor Makanu:

I think the problem here is something else - it's probably an attempt to "do it for me" rather than learn how to solve your problem

Doesn't sound like it. The man posted his handiwork and asked a specific "how to do" question, but to do not what is needed, but what seemed right to him. That is why my answer is that he does not need inverted commas.

And for those who want to print the quotes, just use the function

string kav;
StringSetCharacter(kav, 0, 34);
Print(kav);
 
Alexey Viktorov:

It doesn't look like that. The man posted his craft and asked a specific "how to do" question, but to do not what is right, but what seemed right to him. That is why my answer is that he does not need inverted commas.

And for those who want to print the quotes you just need to use the function

I checked your option.

kav 2

 
SanAlex:

checked out your option...


И?

2021.02.03 13:29:17.584 !00 (EURJPY,W1) "
2021.02.03 13:29:19.884 !00 (EURJPY,W1) "
2021.02.03 13:29:21.944 !00 (EURJPY,W1) "
2021.02.03 13:29:23.804 !00 (EURJPY,W1) "
2021.02.03 13:29:32.704 !00 (EURJPY,W1) "
2021.02.03 13:29:35.434 !00 (EURJPY,W1) "
 
Alexey Viktorov:

И?

I'm learning - Thank you! I'll know now.

kav 3.PNGh