TradeReport

Thingies such as TradeReport and TradeChart
Post Reply
User avatar
renexxxx
Trader
Posts: 860
Joined: Sat Dec 31, 2011 3:48 am

TradeReport

Post by renexxxx »

Here is an indicator that reports on the open or historical trades. There are already a few of these around, but I felt like creating another one. The columns are sortable, with a single mouse-click. Inputs:
  • MagicNumber: Default -1, meaning include all trades
  • StartDate: Take a guess
  • EndDate: Take another guess
  • RefreshMinutes: How many minutes to the next refresh
  • ReportType: OPEN/CLOSED/BOTH: List either OPEN, CLOSED or BOTH open and closed orders. In case of OPEN, the StartDate and EndDate are ignored.
Code attached. Have fun!

UPDATE: I added the option to list both OPEN and CLOSED trades. These are then lumped together and the totals are aggregated.

UPDATE: You can now also filter trades by order comment. There is a new parameter called, CommentFilter (defaults to "") that can be used to only include trades that contain part of the CommentFilter text in their OrderComment(). Note: the string comparison is case sensitive, so if you want trades with comment "CT" and the CommentFilter is "ct", you won't get what you want.

UPDATE: Minor cosmetic update, as suggested by wolfeman: The grand total PIP and Dollar count figure is now better readable.

UPDATE: Added the option to total the trade results by magic number, order comment, as well as by symbol name. For that there is a new parameter, groupBy, that can be SYMBOL (default), MAGIC or COMMENT

UPDATE: Added some color schemes: Beige (Default), Solarized and Turquoise, Magenta and BlackNWhite, as some people didn't like the beige scheme. No change in the functionality.

UPDATE: Under some circumstances (by clicking on something else than a column title), it was possible to get the following error:. In that case, the indicator would 'hang' and would not delete the screen objects when unloaded. This bug has now been fixed.

UPDATE: Added the option to select "Today", "This Week" and "This Month" as special start and end date options. You can still specify your own start and end dates, by selecting "Custom Dates" for the DateChoice. This was a requirement as http://www.stevehopwoodforex.com/phpBB3 ... 7277posted by Bruster400.

UPDATE: There was a bug that prevented you from selecting other screen objects (such as horizontal lines) when TradeReport was running as the OnChartEvent() in trade report would capture the mouse-click to these other objects. This has now been fixed.

UPDATE: Thomas (tomele) has kindly made some cosmetic changes to the format of the report, particularly:
- Added x/yOffset as input
- Changed vertical text alignments
- Changed horizontal text alignment for last row
- Changed colors for last 2 rows
- Some alignments for legend
Thank you Thomas!

UPDATE: It is now possible to filter the result set of trades by either (1) a list of currency pairs or (2) a list of currencies

There is no need to include the symbol extension on your list of symbols, even if your broker uses them. Eg. Don't specify AUDCADc, AUDJPYc, NZDJPYc, but just AUDCAD, AUDJPY, NZDJPY.

UPDATE 2017.09.08: The report can now optionally display some extended statistics as suggested by RiskLessPips: If you set the new parameter ShowExtendedStats to true, it will calculate and display the "Expected earnings per trade" and the "Expected return per dollar" figures. These figures are calculated from the filtered trades as displayed in the report -- not all trades.

UPDATE: 2018.01.31: The input parameter MagicNumbers now expects a comma-separated list of magic numbers, to allow the selection of a subset of trades by magic number. If this parameter is left blank (the default), all magic numbers are selected.

UPDATE: 2018-06-30: Added a save button to allow the saving of selected trades to a CSV file.

UPDATE: 2018-07-18: Additional column 'Nett %' by Paul (Baluda). Well done Paul, you are a star!

UPDATE: 2018-08-24: Added additional groupBy options: group by 'Day of Week', 'Week', or 'Month'

UPDATE: 2018-10-14: Added ability to group by HOUR. Now it is possible to filter by a (comma-separated) list of order comments.

UPDATE: 2019-01-26: Squashed a divide-by-zero bug and updated the default report end date to the end of 2019.

UPDATE: 2019-10-10: As requested by Tebis (Ernst), the nett% profit/loss value can now be calculated relative to (1) the initial balance (default) (2) the current balance (as it was before) and (3) a given custom balance. There are two new parameters: balanceChoice and customBalance. See also: this post.

UPDATE: 2020-06-09: Added a scrollbar and made some other changes so that we can now run multiple TradeReport's on the same screen.

UPDATE: 2020-06-28: Small bug fix regarding the auto sizing of the first column.

UPDATE: 2020-07-19: Now when you select "Just Today's Trades", "Just This Week's Trades" or "Just This Month's Trades", these selections are dynamic, meaning that if the day, week or month ticks over to the next day, week or month, you don't have to re-initialize TradeReport to get the intended date selection.
You do not have the required permissions to view the files attached to this post.
thomasmore
Trader
Posts: 269
Joined: Tue Nov 15, 2011 10:35 pm
Location: Knokke, Belgium

TradeReport

Post by thomasmore »

renexxxx » 23 Oct 2014, 13:48 wrote:Here is an indicator that reports on the open or historical trades. There are already a few of these around, but I felt like creating another one. The columns are sortable, with a single mouse-click. Inputs:
  • MagicNumber: Default -1, meaning include all trades
  • StartDate: Take a guess
  • EndDate: Take another guess
  • RefreshMinutes: How many minutes to the next refresh
  • ReportType: OPEN/CLOSED: List either OPEN or CLOSED orders. In case of OPEN, the StartDate and EndDate are ignored.
It looks like this:


Code attached. Have fun!
Love it! Nice job.
User avatar
milanese
TechAdmin
Posts: 3293
Joined: Wed Jan 09, 2013 9:02 am
Location: btr rdx, r8 +

TradeReport

Post by milanese »

Another great tool from you, thankyou!!

Cheers :)

Tommaso
Global Prime is the official SHF broker :yahoo:
Searching for Servers and Workstations with individual configuration?
Just PM
:smile: Click here to go to the BoardKnowledgeBase
NOTE: Cookies and JavaScript are required for the using the board, with full functionality
User avatar
SteveHopwood
Owner
Posts: 9754
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

TradeReport

Post by SteveHopwood »

Love it. :clap: Adding it to my wrup this week.

:xm:
Read the effing manual, ok?

Afterprime is the official SHF broker. Read about them at https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?p=175790#p175790.

I still suffer from OCCD. Good thing, really.

Anyone here feeling generous? My paypal account is always in the market for a tiny donation. [email protected] is the account.

To see The Weekly Roundup of stuff you guys might have missed Click here

My special thanks to Thomas (tomele) for all the incredible work he does here.
User avatar
rapple
Trader
Posts: 277
Joined: Fri Feb 21, 2014 10:56 pm
Location: Sydney, Australia

TradeReport

Post by rapple »

Hi renexxxx,

Really nice job. :clap:

Would it be possible to include combined OPEN & CLOSE orders?

Kind regards Rap
User avatar
renexxxx
Trader
Posts: 860
Joined: Sat Dec 31, 2011 3:48 am

TradeReport

Post by renexxxx »

rapple » Mon Oct 27, 2014 10:25 am wrote:Hi renexxxx,

Really nice job. :clap:

Would it be possible to include combined OPEN & CLOSE orders?

Kind regards Rap
Do you mean to list the OPEN trades first (in a separate section of the report) and then CLOSED trades, Or
having both OPEN and CLOSED trades lumped together?

Both is possible, but we have to be mindful of the available screen space. If you are trading 28 symbols, you already have 28 lines in the report, you don't want to double that up ...
User avatar
rapple
Trader
Posts: 277
Joined: Fri Feb 21, 2014 10:56 pm
Location: Sydney, Australia

TradeReport

Post by rapple »

renexxxx » Mon Oct 27, 2014 10:29 am wrote:
rapple » Mon Oct 27, 2014 10:25 am wrote:Hi renexxxx,

Really nice job. :clap:

Would it be possible to include combined OPEN & CLOSE orders?

Kind regards Rap
Do you mean to list the OPEN trades first (in a separate section of the report) and then CLOSED trades, Or
having both OPEN and CLOSED trades lumped together?

Both is possible, but we have to be mindful of the available screen space. If you are trading 28 symbols, you already have 28 lines in the report, you don't want to double that up ...
To keep it simple for a start, same number of rows and columns, just add together the OPEN and CLOSE trades (lots, P/L etc). Then have OPEN+CLOSED trades in the comment down the bottom. This would give us an overall equity position from a certain date (good for keeping track of DEMOs)

If there was enough room on the chart it maybe nice to separate OPEN and CLOSED P/L and Pips into separate columns but not mandatory.

Cheers Rap
User avatar
renexxxx
Trader
Posts: 860
Joined: Sat Dec 31, 2011 3:48 am

TradeReport

Post by renexxxx »

I have added the option to list both OPEN and CLOSED trades, lumped together. Update in post 1.
User avatar
rapple
Trader
Posts: 277
Joined: Fri Feb 21, 2014 10:56 pm
Location: Sydney, Australia

TradeReport

Post by rapple »

renexxxx » Mon Oct 27, 2014 11:42 am wrote:I have added the option to list both OPEN and CLOSED trades, lumped together. Update in post 1.
Thank you :good:
bazze

TradeReport

Post by bazze »

A really nice one,renexxxx :good:
Post Reply

Return to “Data analysis tools”