Download MetaTrader 5
To add comments, please log in or register
Freelance service: the safe way to order a trading robot. Try it!
remix919
85
remix919 2015.11.27 01:37 
How can I use OrderCloseTime() to get the month in digits of a closed order? I'm trying to build a script to filter historical results by month, so I would only want to display order results within a selected month, such as month 11 for November.
Keith Watford
Moderator
7892
Keith Watford 2015.11.27 02:00  

TimeMonth()

Note, if you have extended trade history, you may also need to check the year 

remix919
85
remix919 2015.11.27 02:10  

So something like this?

if(OrdHistory>0 && OrderSymbol()==Symbol() && OrderCloseTime() <= TimeMonth())

remix919
85
remix919 2015.11.27 02:11  
if I want to check the trades only for the current month
Keith Watford
Moderator
7892
Keith Watford 2015.11.27 02:44  
if(OrdHistory>0 && OrderSymbol()==Symbol() && TimeMonth(OrderCloseTime())==Month())
will check for current month, but as I said, if you have trade history for more than a year, you may need to check the year.
remix919
85
remix919 2015.11.27 02:58  
ok, thanks =D that worked great!
/
To add comments, please log in or register