TradeChart

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

TradeChart

Post by renexxxx »

I have created a graphical counter part for the TradeReport indicator. It has similar parameters as TradeReport, but rather than summing up the trade figures, it tries to figure out for an historical candle what the equity and balance were at that time. These figures are approximated, by determining which trades were open at/during that candle, and comparing the open symbol's typical price with their open price. This together with the lot size can be converted to a dollar figure. TradeChart plots these figures on a sub chart, together with some other information, like max equity, min equity and draw down etc.. Here is an example of TradeChart together with TradeReport:
Selection_096.jpg
The question that this indicator tries to answer is, "What has been the effect of trading your selected system to your account?" With the parameters MagicNumber, CommentFilter, SymbolFilter and StartDate you can select a sub set of your trades (open and closed), that represent the trades of your EA or strategy you want to analyse.

The indicator is attached below. You will need to allow DLL imports, as TradeChart uses user32.dll, to select "All History" in the History-tab.
I have not included the .mq4-file, not because it is top-secret, but because the code uses an #include file and I want to save myself from a lot of misery of telling people how to compile the code.

Hope this will be of use for someone.

Hint: Sometimes it seems as if the figures don't add up. Play with the time frames on your chart, to force Empty4 to refresh the price data.

Update: The information panel has been extended to also display the report parameters (Start Date, Magic Number etc ...) As the extended panel was/is obscuring most of the chart, I added a close button, so that you can flip the panel away. See:
Selection_098.jpg
There is a weird bug (or undocumented feature) in Empty4, such that if there is no indicator buffer line displayed (eg. due to a set of report parameters that do not result in any trade selection), mouse clicks on screen objects are not registered. To be more precise: they are registered, but the sparam (in OnChartEvent) is blank. In layman terms: if there is no line on the screen, the close button (on the info panel) doesn't work. Go figure.

Update 2016-09-05: (1) Fixed startup bug ... see this post. (2) Added the CurrencyFilter parameter à la TradeReport.

Update: 2016-09-07: Made a significant performance improvement, by 'sucking in' all the orders into an internal structure and sorting them in chronological order, before calculating the balance and UPL for each past candle.

Update: 2016-10-28: Removed a print statement that was left in by mistake for debugging. Thanks Thomas (tomele) for letting me know!

Update: 2017-05-07: A new version (TradeChart3) has been attached, that has improvements to the info-panel. See this Post for more information.

Update: 2017-05-31: There are two small changes:
  • It now takes into account the AccountCredit() -- if your br0ker uses this --, to calculate the Account Balance
  • The applied price type it uses to calculate the UPL for a candle can now be selected from a drop box. The default value is "Typical Price" (i.e. (High + Low + Close)/3 )
You do not have the required permissions to view the files attached to this post.
User avatar
Tebis
Trader
Posts: 111
Joined: Wed Nov 16, 2011 9:50 am
Location: Switzerland

TradeChart

Post by Tebis »

Rene,
thanks a lot for such gr8, valuable Tool !
cheers
Tebis
User avatar
mobthehop
Trader
Posts: 362
Joined: Wed Nov 16, 2011 12:16 am

TradeChart

Post by mobthehop »

wow Rene.. what a wonder of coding - thanks a lot!
porseguro
Trader
Posts: 11
Joined: Sat Dec 07, 2013 2:51 am

TradeChart

Post by porseguro »

Thank you Rene, great coding
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.

TradeChart

Post by SteveHopwood »

There should be some interest here now.

Thanks Rene, for yet more fabulous work. :clap: :clap: :clap: :clap: :clap:

: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
renexxxx
Trader
Posts: 860
Joined: Sat Dec 31, 2011 3:48 am

TradeChart

Post by renexxxx »

There was a request to also display the report parameters on the info panel. Update is in Post 1
Pipologist
Trader
Posts: 34
Joined: Tue Dec 16, 2014 12:57 am
Location: Crawley, UK.

TradeChart

Post by Pipologist »

Thank you Rene for this very useful tool :good:
User avatar
mobthehop
Trader
Posts: 362
Joined: Wed Nov 16, 2011 12:16 am

TradeChart

Post by mobthehop »

Rene,

all is good on all demo accounts but one.... see attached...

It is a new demo account 5000 starting capital, opened last Thursday...

The percet-gain is correct but max / min equity is /are simply impossible...

What can I provide in terms of info for you to locate the "gremlin"?

Cheers
You do not have the required permissions to view the files attached to this post.
User avatar
renexxxx
Trader
Posts: 860
Joined: Sat Dec 31, 2011 3:48 am

TradeChart

Post by renexxxx »

mobthehop » Tue Aug 18, 2015 6:23 pm wrote: What can I provide in terms of info for you to locate the "gremlin"?
Did you already play with the time frames (flipping from one to the other) to get it to behave properly? If you did, I have to scratch my head a bit more...
User avatar
mobthehop
Trader
Posts: 362
Joined: Wed Nov 16, 2011 12:16 am

TradeChart

Post by mobthehop »

renee,

changing tfs is first thing that came to mind, so ....

This is a cowboy set of Dynamo.... any use if I send you the closed trade report in html or better in csv?

Cheers
Post Reply

Return to “Data analysis tools”