Get the Month of a closed order?

Back to topics list To post a new topic, please log in or register
avatar
29
remix919 2015.11.27 02: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.
avatar
Moderator
3411
GumRai 2015.11.27 03:00 #
 

TimeMonth()

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

avatar
29
remix919 2015.11.27 03:10 #
 

So something like this?

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

avatar
29
remix919 2015.11.27 03:11 #
 
if I want to check the trades only for the current month
avatar
Moderator
3411
GumRai 2015.11.27 03: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.
avatar
29
remix919 2015.11.27 03:58 #
 
ok, thanks =D that worked great!
Back to topics list  

To add comments, please log in or register