How to close all Orders before day will ends?

 

If Orders set by market, also. It's possible to do? I have problem with high price change at new day begun ...

It' PYTHON!

 
sergey087:
If Orders set by market, also. It's possible to do? I have problem with high price change at new day begun ...

Close the orders before the market closes for the day for the symbol. Either manually or by an EA.
If you mean by an EA, show your coding attempt.

 
Keith Watford #:

Close the orders before the market closes for the day for the symbol. Either manually or by an EA.
If you mean by an EA, show your coding attempt.

No. It's python ... How to get time when market close today per Symbol? I think if I do it one minutes before market will close ... It's so real bad what I can't include it into the Order =(

It will work for pending Orders? If I change Order' type ... 
 
sergey087 #:

No. It's python ... How to get time when market close today per Symbol? I think if I do it one minutes before market will close ... It's so real bad what I can't include it into the Order =(

It will work for pending Orders? If I change Order' type ... 

When posting, if you are asking about coding with python, please state that fact in your first post.

 
Keith Watford #:

When posting, if you are asking about coding with python, please state that fact in your first post.

Ok, I didn't know what it's important ... 

 
sergey087 #:

Ok, I didn't know what it's important ... 

Of course it is important.
Somebody could waste their time by replying and assuming that you are talking about pure MQL5 code.

 
Keith Watford #:

Of course it is important.
Somebody could waste their time by replying and assuming that you are talking about pure MQL5 code.

Good I edited it, time to editing don't ends ... 

        CurrentTick = mt5.symbol_info(Symbol)._asdict()
        print(CurrentTick["time"])



I have it, but I don't know how to get market' close time for the Symbol ... It's so easy to do if I can get it ...

 
sergey087 #: Good I edited it, time to editing don't ends ... I have it, but I don't know how to get market' close time for the Symbol ... It's so easy to do if I can get it ...

Unfortunately, the Python API is very limited compared to what is available via the native MQL5 language.

The session trade times is only available via the MQL5 function SymbolInfoSessionTrade. As far as I a can see, there is nothing equivalent for Python.

Consider writing your EA in MQL5 instead of Python. There are many advantages in writing your EA in MQL5 instead of Python.

EDIT: For now, you can consider using a input parameter in your Python code to define the closing time, instead of reading the symbol information. This is how it is done in MQL4 too as it does not have this functionality either.

Documentation on MQL5: Market Info / SymbolInfoSessionTrade
Documentation on MQL5: Market Info / SymbolInfoSessionTrade
  • www.mql5.com
SymbolInfoSessionTrade - Market Info - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
 
Fernando Carreiro #:

Unfortunately, the Python API is very limited compared to what is available via the native MQL5 language.

The session trade times is only available via the MQL5 function SymbolInfoSessionTrade. As far as I a can see, there is nothing equivalent for Python.

Consider writing your EA in MQL5 instead of Python. There are many advantages in writing your EA in MQL5 instead of Python.

EDIT: For now, you can consider using a input parameter in your Python code to define the closing time, instead of reading the symbol information. This is how it is done in MQL4 too as it does not have this functionality either.

Thanks, it's so bad news and so good news also =( 

Reason: