Questions from Beginners MQL5 MT5 MetaTrader 5 - page 955

 
User_mt5:

Gee)) That's what I thought too.

Turns out it's Environment State.

Show me with your finger where it is in the environment state? I only see it in graph operations




 

MQLInfoString() Here:

https://www.mql5.com/ru/docs/constants/environment_state/mql5_programm_info

And yes, in the charts, there is too. I missed it. I must have been brooding:)

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

MQLInfoString() Here:

https://www.mql5.com/ru/docs/constants/environment_state/mql5_programm_info

And yes, in the charts, there is too. I missed it. I must have been brooding:)

It's strictly my own name. That's not it at all.

 
Help me out here, folks, if you don't mind... I'm racking my brain, I can't spot the error.
Bottom line:
I place Stop orders and subsequently modify them.
When I place one order at a time, everything is fine and when I test it, it modifies everything as intended.

There are no errors in the log.

2018.12.06 21:02:19.226 Core 1  2018.12.04 17:59:40   order modified [#495  buy stop 0.10 EURUSD at 1.13901]
2018.12.06 21:02:19.226 Core 1  2018.12.04 17:59:40   CTrade::OrderSend: modify #495  at 1.13901 (sl: 0.00000 tp: 0.00000) [done]
2018.12.06 21:02:19.226 Core 1  2018.12.04 19:03:40   order modified [#495  buy stop 0.10 EURUSD at 1.13763]

When I try to set two opposite orders, I get a mess... like this:

2018.12.06 21:09:06.985 2018.01.02 11:59:00   failed modify order #2  buy stop 0.10  at 1.20687 sl: 0.00000 tp: 0.00000 -> 1.20270, sl: 0.00000 tp: 0.00000 [Invalid price]
2018.12.06 21:09:06.985 2018.01.02 11:59:00   CTrade::OrderSend: modify #2  at 1.20270 (sl: 0.00000 tp: 0.00000) [invalid price]
2018.12.06 21:09:06.986 2018.01.02 11:59:20   failed modify order #2  buy stop 0.10  at 1.20687 sl: 0.00000 tp: 0.00000 -> 1.20264, sl: 0.00000 tp: 0.00000 [Invalid price]

I guess what[Invalid price] means. But I don't understand why it's the same... ...doesn't come up when I place one order. It makes me think it's not the price...

Maybe this is because I have specified SL and TP of 0.0 in the order modification, but the compiler never demanded this from me when I placed the order and let me place the order without any of them.

Maybe it was the slippage, but I did not see such a problem when I set the positions in a similar way, or maybe it was because I opened the orders incorrectly or tried to determine them incorrectly with the ticket... and/or magik.

I'm testing on demo, alparencies quotes, hedge-enabled account.

The error occurs before the order triggering, at first modification, (no lacquering Pos. yet) and when one of the orders triggers in a position, the error disappears and the remaining order is modified as nice.

Maybe I misprinted a dirty word somewhere in the code...

Don't blame me, I have an alibi... I've been working with mql5 for a few days now... Wha... fuck! His... developers... were healthy))))

I felt like I was on an alien ship where everything was covered in some kind of incomprehensible aliens' characters which sometimes turned into cuneiform...

Thank God, in the alien ship's logbook, I found two familiar words Commtnt and Print...

Files:
 

Hi all!

Has anyone ever tried to select/hide a custom symbol via CustomSymbolSetInteger?

This method requires 3 input parameters: symbol name, property ID and long type value.



However, the documentation shows that the SYMBOL_VISIBLE property requires the property type bool


How to set this property identifier to the correct value???

I tried setting it to "true", but error 5307 - Invalid custom character property

 
Rustam Esedulaev:

Hi all!

Has anyone ever tried to select/hide a custom symbol via CustomSymbolSetInteger?

This method requires 3 input parameters: symbol name, property ID and long type value.



However, the documentation shows that the SYMBOL_VISIBLE property requires the property type bool


How to set this property identifier to the correct value???

I tried setting it to "true", but error 5307 - Invalid custom character property

I haven't checked on the custom ones, but similar to the normal ones, there should be no open charts and positions/orders to hide the symbol.

 
vladzeit:
***

*** hedge-backed account.

***

Nowhere in the code do you take into account that the account is hedged (i.e. you don't calculate pending orders and you don't calculate positions).

Second: in order to work with something (a pending order, for example) it must first be SELECTED and only then refer to its properties.

You have to: start designing your EA anew, step by step. Let us assume step 1: first, decide on the values we want to set the SL and TP (points or pips). Step Two: calculate the pending orders. Step three: if there are no pending orders - place a pending order. Step four: Think about what happens when the pending order triggers. Step ...

 
Vladimir Karputov:

Please start reading CAREFULLY:1. This indicator is for MetaTrader 5.


Further questions will be moved to the branch for beginners

I work in MT5 and the attached code is also for MT5

 
Boris Egorov:

I work in MT5 and the attached code is also for MT5

Read the help section on how to create indicator handles properly.

Example code is in the help for any built-in indicator.

 
Vladimir Karputov:

Nowhere in the code do you take into account that the account is a hedge (i.e. you do not count pending orders and you do not count positions).

Second: In order to work with something (a pending order, for example), you must first SELECT it and only then refer to its properties.

You have to: start designing your EA anew, step by step. Let us assume step one: first, decide on the values we want to set the SL and TP (points or pips). Step Two: calculate the pending orders. Step three: if there are no pending orders - place a pending order. Step four: Think about what happens when the pending order triggers. Step ...V.

Vladimir, thanks for the instruction. I will modify it following your logic. In your example EA(Hoop master 2), I have already looked at how and when you use the order and position bookkeeping and refer to their properties.

I'll try the analogy.

Reason: