Discussion of article "LifeHack for trader: "Quiet" optimization or Plotting trade distributions"

 

New article LifeHack for trader: "Quiet" optimization or Plotting trade distributions has been published:

Analysis of the trade history and plotting distribution charts of trading results in HTML depending on position entry time. The charts are displayed in three sections - by hours, by days of the week and by months.

This article offers a slightly different look at the process of creating a trading robot. Before running the optimization of input parameters, you can simply look at the distribution of profits and losses depending on the time of entry. After all, many strategies have "favorable" and "unfavorable" moments for entering the market. This article considers plotting distribution charts of position profitability (please note, not deals, but the exactly positions!) depending on their opening times. After studying these charts, it will be possible to look at the strategy from a slightly different point of view.

The charts are plotted by calling the Google Charts. And for their visual representation, the HTML has been selected. Schematically, the distribution charts are displayed on the page as a table:

 

Fig. 1. The appearance of the HTML report 

Author: Karputov Vladimir

 
It would be good to add these charts to the standard tester report. Otherwise it is much weaker than signal reports...
Well, a separate plug-in is also good)
Thanks!
 

It is not clear why it was necessary to recalculate positions from deals.

Add up the results of all deals for each instrument - in the end we will get profit/loss distribution for it.

How is counting by deals more convenient? For example, a position was held for a week, and there were 100 deals during this time. Distribution by days and hours will be better filled in.

 
elibrarius:

1. It is not clear why it was necessary to recalculate from trades - positions.

...

A position is a holistic characteristic, while an order and a trade is a piece of it.
elibrarius:

...

2. How is counting by trades more convenient? For example, a position was held for a week, and there were 100 deals during this time. Distribution by days and hours will be better filled.

In fact, very often a position consists of only two deals - the first one is an entry and the second one is an exit.
 
Karputov Vladimir:

A position is a holistic characteristic, while an order and a transaction are a piece of it.

In the final report we do not see individual positions, we see their sum. And adding up the results by deals or the results by positions, we will get the same sum at the end of calculations. But adding up just deals is easier and as I mentioned earlier - the distribution by days and hours will be better filled in.

In fact, very often a position consists of just two trades - the first one is an entry and the second one is an exit.

In the same multicurrency, which you have taken for an example, when profit on a position grows, additional trades are added to it. And only if the position is unsuccessful - closing and reopening. Or there can be such a variant - it was successful, a couple of fills were made, but the price went the wrong way and only then closed and reversed the position. So the variant with only 2 trades is a special case.

Couldn't you add calculation by trades as an option? I, for example, would use it. Or can't articles be changed after publication?

 
elibrarius:


The main idea is to analyse the time of position entry. Only this parameter is analysed, which, by the way, shows very well on report charts the time when entries are successful and when they are not.
 
Great work!
 
Trading Distribution Great tool!
 

Thank you for your contribution,

Excellent material.

 

This is where zero division sometimes occurs :

                     temp=(m_arr_struct_positions[j].prev_volume*m_arr_struct_positions[j].prev_price+volume*price)/
                          (m_arr_struct_positions[j].prev_volume+volume);

2016.12.10 00:01:41.696 Core 1 2016.12.05 23:59:55 zero divide in 'DistributionOfProfits.mqh' (292,116)
 
Is there any way to add the Average Equity Drawdown by hour?