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

 
Can you suggest a function? Suppose there is an open order (no matter where), and it is open for more than 3 hours, or more than 2 days (in general, we set some time), then I want to write further actions. Question. How to countdown the code, how long the order is open. Thank you.
 
Порт-моне тв long the order is open. Thank you.
TimeCurrent()-OrderOpenTime()=время в секундах
 
MakarFX #:

So simple. Thank you.

 
There's still a problem I can't solve. From time to time there is a problem with order doubling. It means that two orders with the same parameters are opened at the same time instead of one. It happens randomly. How can we overcome this? Maybe there is a recheck for one opening or at least we can close the second one using the same parameters(open price, lot or time). Thank you.
 
Порт-моне тв (open price, lot or time). Thank you.
Show me the code
 
Hi, I am coming across the need to create a sub window for indicator (like for stochastic), but it needs to be done programmatically from within the trading robot's code. Can you please advise how to do it.
P.S. I also thought about running an "empty" indicator with indicator_separate_windows property by means of DLL, but I don't know how to implement it.
I will be grateful for any help.
 
Сергей Коваленко #:
Hi, I am coming across the need to create a sub window for indicator (like for stochastic), but it needs to be done programmatically from within the trading robot's code. Can you please advise how to do it.
P.S. I also thought about running an "empty" indicator with indicator_separate_windows property by means of DLL, but I don't know how to implement it.
I will be grateful for any help.
ChartApplyTemplate
 
MakarFX #:
ChartApplyTemplate
Thank you! It's much easier than I thought ;)
 
Please advise if anyone knows how to connect MT4 or MT5 with PHP ? I want my trading robot to work on server, request quotes from broker and create/cancel/monitor orders. The broker only has MT4 and MT5 terminals, it doesn't have API :) Or am I stupid and it doesn't happen at all?
 
MakarFX #:
ChartApplyTemplate

What will it do?

For example, there is no EA in the template... Everything is clear... the EA does not work...

The template has an EA: The EA is initialised... The template is applied, a new copy of the EA is loaded, the EA is initialised and the template ......... is applied again

It goes on and on... Or am I missing something?

Reason: