• Overview
  • Reviews (1)
  • Comments (5)
  • What's new

Trade history

The indicator plots charts of profit taken at the Close of candles for closed (or partially closed) long and short positions individually. The indicator allows filtering positions by the current symbol and specified expert ID (magic number), to set the start time and the periodicity of profit reset (daily, weekly or monthly) to calculate the profit chart. The indicator also displays the floating (not fixed) profit of the positions opened after its was launched, according to the filter settings at the candle closure.

The indicator works with any timeframes and instruments (including stock exchange). It can be useful for analysis of efficiency of multiple experts trading on different symbols and directions on one account from a certain point of time.

The available history of deals fixing a profit is used to plot charts of the fixed profit.

Additional features of new versions of the indicator are described in the What's New tab.

You can test the work of the indicator using the free demo version: Trade history demo.


Indicator Parameters

  • Current symbol only - boolean parameter (true/false), indicating the need for filtering deals by the current symbol.
  • Use expert ID filter - boolean parameter (true/false), indicating the need for filtering deals by expert advisor ID (magic number).
  • Expert ID (magic number) - expert advisor ID (integer) which is used in filtering deals by expert ID (for manual trading expert ID equals 0). This parameter is not used when the Use expert ID filter option is set to false.
  • Profit values in - parameter of enumeration type with the values deposit_currencypercentage_of_start_balance to select profit units.
  • Take into account commissions and swaps - boolean parameter (true/false), indicating the need for accounting of commission and swap of deals.
  • Show profit curves for buy & sell positions - boolean parameter (true/false), indicating the need to display separate charts of fixed profit for long and short positions.
  • Start time - date & time parameter, specifying the initial time moment for calculating charts of fixed profit.
  • Reset profit at - parameter of enumeration type with the values no_reset, day_begin, week_begin, month_begin. It indicates the need for daily, weekly or monthly reset of profits.


The indicator plots (lines)

  1. Floating profit - line (solid yellow by default) showing floating (not fixed) profit of positions opened according to the filter settings at the candle closure since the indicator was launched.
  2. Fixed profit - line (solid lime by default) showing fixed profit at the candle closure for closed (or partially closed) long and short positions according to the filter settings.
  3. Fixed profit (buy) - line (dotted blue by default) showing fixed profit at the candle closure for closed (or partially closed) long positions according to the filter settings. This line is not visible when the Show profit curves for buy & sell positions option is set to false.
  4. Fixed profit (sell) - line (dot red by default) showing fixed profit at the candle closure for closed (or partially closed) short positions according to the filter settings. This line is not visible when the Show profit curves for buy & sell positions option is set to false.
  5. Invisible service buffer - hidden auxiliary buffer which should be ignored.
Recommended products
Filter:
Arthur Albano
735
Arthur Albano 2019.07.26 02:10   

It works with Brazilian Bovespa / B3 / BMF. I want to suggest 3 (three) new assets calculator:

//+------------------------------------------------------------------+

//| PositionsPriceOpen.mq5 |

//| Arthur Albano |

//| https://www.mql5.com/en/users/arthuralbano |

//+------------------------------------------------------------------+

#property copyright "Arthur Albano"

#property link "https://www.mql5.com/en/users/arthuralbano"

#property version "1.00"

//+------------------------------------------------------------------+

//| Script program start function |

//+------------------------------------------------------------------+

void OnStart()

{

}

double PositionsLevelOpen()//sum of all POSITION_PRICE_OPEN

{

double result = 0.0;

if(PositionsTotal()==0) return(0.0);//no positions; trivial solution

for(int i=(PositionsTotal()-1);i>=0;i++)

{

if(PositionSelect(PositionGetSymbol(i))) result = result + PositionGetDouble(POSITION_PRICE_OPEN)*PositionGetDouble(POSITION_VOLUME);

}

return(result);

};

double PositionsLevelBid()//sum of all SYMBOL_BID, usefull for closing all positions at market

{

double result = 0.0;

if(PositionsTotal()==0) return(0.0);//no positions; trivial solution

for(int i=(PositionsTotal()-1);i>=0;i++)

{

if(PositionSelect(PositionGetSymbol(i))) result = result + SymbolInfoDouble(PositionGetSymbol(i),SYMBOL_BID)*PositionGetDouble(POSITION_VOLUME);

}

return(result);

};

double PositionsLevelCurrent()//sum of all POSITION_PRICE_CURRENT

{

double result = 0.0;

if(PositionsTotal()==0) return(0.0);//no positions; trivial solution

for(int i=(PositionsTotal()-1);i>=0;i++)

{

if(PositionSelect(PositionGetSymbol(i))) result = result + PositionGetDouble(POSITION_PRICE_CURRENT)*PositionGetDouble(POSITION_VOLUME);

}

return(result);

};

If correctly implemented, I will buy it.

Version 1.2 2019.07.05
Added new features:
- selection of profit units using the new parameter "Profit values ​​in" (deposit currency, percentage of balance);
- accounting of commission and swap of orders (the new parameter "Take into account commissions and swaps") when calculating profit in units of deposit currency or percentage of balance.
Version 1.1 2017.06.07
1. Now the daily, weekly and monthly profit (set by the "Reset profit at" parameter) is reset only on timeframes lower than D1, W1 and MN, respectively.
2. Fixed an error which occurred when launching the indicator on a chart with less than two downloaded bars.
3. Fixed a rare error, which occurred when the indicator ignored the closing trade at the last tick of the last bar.