Filtering by hours

I have a request to improve how currently QuantAnalyzer list orders from imported Strategy Reports.
It should be very simple to implement, but very powerful and helpful for users.
When I use the What If - analysis I want a separate column for

hours of the day. 

This way I could order the trades by the hour of
the day and see if there are many losses on certain hours of the day,
and much more importantly I will be able to see at the right side if
those losses tend to be big or small. Same test could be done to see at what hour of the day the big winners tend to occur. 
Currently a column has date and hour in one. So it is not possible to rank by the hour of the day.

Thanks to your QA tool I have dramatically improved the performance of many EA's by finding the right hours within a day to trade the EA (or which hours to filter out).
But if there are many orders in the backtest of hundreths of days it is impossible for me to list the trades by HOUR of the day (entry-hour).

See attached photo for what I'd like to see:
Ability to rank trades by hour (of entry). 
If I could rank trades by the hour, it would allow me to go to all trades of 04 entry hour and see immediately on the right side whether there were few big losses of many small losses and I could see if 
there are many big winning trades or where the winning trades relatively small. In one overview I could get much better idea about how good/bad the trades tend to be during that hour.

Of course, if you guys want you could go 1 step further and implement this for YEAR and even Closing hour as well.
You want to go completely Pro? Than give the user the ability to select time periods like "Show: Trades opening between 09:30 and 09:45". 
I don't need this myself but I know a ton of traders that would love to be able to find detail statistics of specific strategies that trade at specific intervals only.


(373.55 KiB)
  • Votes +2
  • Project QuantAnalyzer
  • Type Feature
  • Status Fixed
  • Priority Normal




27.05.2019 17:10

Task created



27.05.2019 17:10
Voted for this task.


27.05.2019 19:19
if you have strategies with pending orders you cant trade them in only selected hours, so you cant use WHAT IF


27.05.2019 19:54

That is obvious. It works perfect for market orders. 

But I have been using it with pending orders as well. Only when the expiry time of the pending order is relatively very short (i.e. within the hour). This is useful when you want price to retrace a bit before entering, rather than entering at market. It works great with scalping strategies. So, my suggestion works perfect for market orders, but can be used for pending orders as well (under the condition I stated above). What I do with finding good pending order settings is to first find the best trading hours for market orders and run the EA only on those hours, than I add a pending order with short expiry time and optimize the EA for pip distance to place the pending orders at. 



28.05.2019 07:08
yes, this is true

i am using this method, but without changes in the MQL code, i need to use some copier from one account to another, where i can set the hours



03.07.2019 08:16

Status changed from New to Fixed

For analysing trades by hours we have some special charts on Trade analysis tab : Win/Losses by hour, PL by hour, Trades by hour

If you need to create a new column or what if definition it should be easy.

Open QuantEditor, create a new snippet and get a code from the snippets below

TradeListColumns/OpenTime, TradeListColumns/CloseTime 

change line

return new SQTime(openTime/closeTime).getHour()


change line

if(new SQTime(order.OpenTime).getHour()<=hourFrom || new SQTime(order.CloseTime).getHour()>=hourTo )

If you need a help please attach your custom snippets and I will correct them.



01.08.2019 15:30
Voted for this task.

Votes: +2

Drop files to upload


choose files

Max size: 5MB

Not allowed: exe, msi, application, reg, php, js, htaccess, htpasswd, gitignore

Wait please