Average Position Holding Time

 

As I'm going through my backtest report. I was looking at this and thinking if this information is important.

If the average position holding time is very low, does it means that my EA is more accurate and robust compare to a value that is higher?

and where can I get this for use in Custom Max

 
anyone?
 
anyone know where I can get the average holding time for use in custom max?
 
doshur:

As I'm going through my backtest report. I was looking at this and thinking if this information is important.

If the average position holding time is very low, does it means that my EA is more accurate and robust compare to a value that is higher?

and where can I get this for use in Custom Max

Sounds like (Sum_All_Closed_Positions (Position_Close_Time - Position_Open_Time)) / Total_Positions. What do you mean by Custom Max?
 
Ubzen:
Sounds like (Sum_All_Closed_Positions (Position_Close_Time - Position_Open_Time)) / Total_Positions. What do you mean by Custom Max?

I mean for use in On_Tester()

https://www.mql5.com/en/docs/constants/environment_state/statistics

There is nothing for average position time. Able to request to be included?

Documentation on MQL5: Standard Constants, Enumerations and Structures / Environment State / Testing Statistics
Documentation on MQL5: Standard Constants, Enumerations and Structures / Environment State / Testing Statistics
  • www.mql5.com
Standard Constants, Enumerations and Structures / Environment State / Testing Statistics - Documentation on MQL5
 
doshur:

I mean for use in On_Tester()

https://www.mql5.com/en/docs/constants/environment_state/statistics

There is nothing for average position time. Able to request to be included?

I didn't see it in the list ... but you already knew that. Have you tried calculating it yourself?
 
doshur:

I mean for use in On_Tester()

https://www.mql5.com/en/docs/constants/environment_state/statistics

There is nothing for average position time. Able to request to be included?

Ubzen gives you the formula to calculate it yourself. Then you can use it as Custom Max.

Creating Custom Criteria of Optimization of Expert Advisors
Creating Custom Criteria of Optimization of Expert Advisors
  • 2011.09.07
  • Dmitriy Skub
  • www.mql5.com
Introduction The MetaTrader 5 Client Terminal offers a wide range of opportunities for optimization of Expert Advisor parameters. In addition to the optimization criteria included in the strategy tester, developers are given the opportunity of creating their own criteria. This leads to an almost limitless number of possibilities of testing and...
 
doshur:

As I'm going through my backtest report. I was looking at this and thinking if this information is important.

If the average position holding time is very low, does it means that my EA is more accurate and robust compare to a value that is higher?

Yes. Absolutelly. I think "Average Position Holding Time" is important and does it means EA or Signal is more accurate. Perhaps, more clear would be to indicate standardized minimum and maximum, instead of just avarage. For example, if your EA needs 5 days till close the trade in profit, it also means that during those days was highly probably quite big drawdown in equity (unrealized loss/profit till close the trade). Such EA/Signal would certainly blown out all lower size accounts, while big size accounts will not be hurted by your EA drawdown during those days. On the opposite, if your EA close the trade in 15 minutes with profit, and also with low relative drawdown (in usd and % of acconut size) during that holding time, it means that all account types are profitable and happy with your EA. Lot size should be adjusted per account size. (increase lot size to increase gains in well-capitalized accounts, and reduce risk of losing everything in under-capitalized accounts). Position Holding Time is also important for planning the trade.

 
angevoyageur:

Ubzen gives you the formula to calculate it yourself. Then you can use it as Custom Max.

correct me if I'm wrong here

So I need to declare global variables and store the position holding time(s) everytime my trade closed in On_Tick() and used it in custom max (on_Tester) later?

Can metaquotes give us a simpler solution? Should I write to ServiceDesk to appeal for this statistic? 

Get in touch with developers using Service Desk!
Get in touch with developers using Service Desk!
  • www.mql5.com
We therefore attach great importance to all user reports about issues in our programs and try to answer each one of them.
 
Vorobyov:

Yes. Absolutelly. I think "Average Position Holding Time" is important and does it means EA or Signal is more accurate. Perhaps, more clear would be to indicate standardized minimum and maximum, instead of just avarage. For example, if your EA needs 5 days till close the trade in profit, it also means that during those days was highly probably quite big drawdown in equity (unrealized loss/profit till close the trade). Such EA/Signal would certainly blown out all lower size accounts, while big size accounts will not be hurted by your EA drawdown during those days. On the opposite, if your EA close the trade in 15 minutes with profit, and also with low relative drawdown (in usd and % of acconut size) during that holding time, it means that all account types are profitable and happy with your EA. Lot size should be adjusted per account size. (increase lot size to increase gains in well-capitalized accounts, and reduce risk of losing everything in under-capitalized accounts). Position Holding Time is also important for planning the trade.

Now I'm finding ways to get this into custom max so that my parameters are more "robust"
 
Anyone with this formula for the OnTester? Could be really useful.

Testing Statistics (https://www.mql5.com/en/docs/constants/environment_state/statistics) doesn't provide yet this parameter that we can see in the Tester Report: Average Position Holding Time
Documentation on MQL5: Constants, Enumerations and Structures / Environment State / Testing Statistics
Documentation on MQL5: Constants, Enumerations and Structures / Environment State / Testing Statistics
  • www.mql5.com
Testing Statistics - Environment State - Constants, Enumerations and Structures - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
Reason: