In addition to the TradeReport, I have created a little indicator that plots the current profit/loss of an open basket over time. For instance:
You just give it a MagicNumber and it will plot the profit levels. (It stores a data point for each reading in a binary file, so that when the indicator is restarted, it still has all the data). As this is just an indicator, we can apply other indicators (such as Moving Average) to the profit plot, and this might give us some ideas as to when to close a basket of trades. Hopefully, people much smarter than me, can use this to come up with a basket exit strategy.
Initially this is best viewed on the M1-chart. When you accumulate enough data points, you can switch M5 and higher.
There might still be some bugs in, as I haven't spend a lot of time testing it. If so, please shout! When it is first started, it prints out a message that it can't file the data file ... duh, there is no data file yet. That will be created when it stores the first data point Just ignore.
Code attached.
Have fun,
Edit: 24.03.2015: Fixed a few bugs ...
ProfitPlot
- renexxxx
- Trader
- Posts: 860
- Joined: Sat Dec 31, 2011 3:48 am
ProfitPlot
You do not have the required permissions to view the files attached to this post.
Last edited by renexxxx on Sat Oct 25, 2014 8:42 pm, edited 2 times in total.
- fxozgirl
- Trader
- Posts: 1176
- Joined: Wed Nov 16, 2011 9:16 am
- Location: Melbourne, Australia
ProfitPlot
Awesome Rene...
thanks for sharing both indicators, this profit plot indi will be particularly helpful

thanks for sharing both indicators, this profit plot indi will be particularly helpful
-
dudest
- Trader
- Posts: 1847
- Joined: Tue May 08, 2012 2:37 pm
ProfitPlot
You're on a roll!
Merci beaucoup :)
Merci beaucoup :)
-
bazze
ProfitPlot
Thanks for this,but got this alert when trying to attach it? Nothing shows up on the chart?
You do not have the required permissions to view the files attached to this post.
-
dudest
- Trader
- Posts: 1847
- Joined: Tue May 08, 2012 2:37 pm
ProfitPlot
Hi bazze,bazze » Fri Oct 24, 2014 5:50 pm wrote:Thanks for this,but got this alert when trying to attach it? Nothing shows up on the chart?
Is your MT installed under Program Files by any chance?
.
- renexxxx
- Trader
- Posts: 860
- Joined: Sat Dec 31, 2011 3:48 am
ProfitPlot
This was mentioned in the first post ...bazze » Sat Oct 25, 2014 12:50 am wrote:Thanks for this,but got this alert when trying to attach it? Nothing shows up on the chart?
1. Initially you get an error message that the data file does not exist. The reason is, that the file has not been created yet, but it is the first thing the indicator will do.
2. The reason, that initially your screen looks empty, is also, because there are no data points yet. I noticed that you have opened a H1 chart. It will take a while before you get any significant movement on the H1-chart. That's why I suggested to start with a M1-chart.
May be you should read the first post ... For your convenience, I have put the link to the first post here
- renexxxx
- Trader
- Posts: 860
- Joined: Sat Dec 31, 2011 3:48 am
ProfitPlot
If you're like me and leave your terminal running during market close with trades open, you might want to download the update to this indi in post 1, as the original version kept adding data points to the log file, even when no new ticks were received. This has now been resolved.
Also, from a housekeeping perspective, it might be worth to go from time-to-time through your \Files folder and remove the PP_*.bin files you don't need any more. By default, these files grow by 12 bytes every minute, and although that is not that much, it does add up over time.
Also, from a housekeeping perspective, it might be worth to go from time-to-time through your \Files folder and remove the PP_*.bin files you don't need any more. By default, these files grow by 12 bytes every minute, and although that is not that much, it does add up over time.
- renexxxx
- Trader
- Posts: 860
- Joined: Sat Dec 31, 2011 3:48 am
ProfitPlot
In order to see multiple "ProfitPlot"s in the same window, I have created the ProfitMonitor indicator.
It looks like this: So, what does it do and how does it work?
It works in conjunction with ProfitPlot. ProfitPlot is installed on a chart and provided with a MagicNumber that it needs to watch. ProfitPlot works out the UPL for the given magic number and writes this periodically to a file in the common area (somewhere like: C:\Documents and Settings\<username>\Application Data\MetaQuotes\Terminal\Common\Files). This data file has a name like: PP_<accountNumber>_<magicNumber>.bin (eg. PP_207331_45589.bin). All terminals can write to the common area, but by using this naming convention, the file name should be unique.
ProfitMonitor picks up these files and plots them in one (separate) chart. It can handle up to 8 files (as Empty4-indi's can have only 8 buffers...)
What's the point of all this?
The market moves in waves. Some strategies are better suited for certain market conditions than others. The idea is to have several strategies (possibly basket) strategies running on several terminals and each of them produce a ProfitPlot-file at real time. By watching ProfitMonitor, you can 'see' when a certain strategy is gaining (is in an upward-trend). That would be the time to start that particular strategy on a live account. Obviously, you'd hope that the upward-trend would continue for a while. If this proves to be the case in the majority of cases, the next step could/would be to create a little EA, that reads these ProfitPlot-files and shoots of trades when the time is ripe. We are then moving into the field of 'profit-curve trading'.
Oh, and before someone shouts out: "It doesn't work!", "I see nothing on my screen", "I get an error message", the following:
Edit: 24.03.2015: Added the legends for the profit curves.
It looks like this: So, what does it do and how does it work?
It works in conjunction with ProfitPlot. ProfitPlot is installed on a chart and provided with a MagicNumber that it needs to watch. ProfitPlot works out the UPL for the given magic number and writes this periodically to a file in the common area (somewhere like: C:\Documents and Settings\<username>\Application Data\MetaQuotes\Terminal\Common\Files). This data file has a name like: PP_<accountNumber>_<magicNumber>.bin (eg. PP_207331_45589.bin). All terminals can write to the common area, but by using this naming convention, the file name should be unique.
ProfitMonitor picks up these files and plots them in one (separate) chart. It can handle up to 8 files (as Empty4-indi's can have only 8 buffers...)
What's the point of all this?
The market moves in waves. Some strategies are better suited for certain market conditions than others. The idea is to have several strategies (possibly basket) strategies running on several terminals and each of them produce a ProfitPlot-file at real time. By watching ProfitMonitor, you can 'see' when a certain strategy is gaining (is in an upward-trend). That would be the time to start that particular strategy on a live account. Obviously, you'd hope that the upward-trend would continue for a while. If this proves to be the case in the majority of cases, the next step could/would be to create a little EA, that reads these ProfitPlot-files and shoots of trades when the time is ripe. We are then moving into the field of 'profit-curve trading'.
Oh, and before someone shouts out: "It doesn't work!", "I see nothing on my screen", "I get an error message", the following:
- Put the ProfitPlot-indicator on a M1 chart and give it the magic number of the strategy (EA) you want monitored. Do this for each EA you want to include. This can be on the same terminal or on different terminals. You will get an error message in the Experts-tab, that informs you that the data-file does not exist (yet). Initially, you will see nothing ... as it creates its own data going forward. You may need to play with zoom-in and zoom-out, page-up, page-down etc etc to get Empty4 to display something.
- Put the ProfitMonitor-indicator on another chart/terminal. At this stage, nothing smart is happening (no trades are opened or closed), this is just to see what's happening.
Edit: 24.03.2015: Added the legends for the profit curves.
You do not have the required permissions to view the files attached to this post.
-
arts
- Trader
- Posts: 10
- Joined: Thu Nov 17, 2011 2:09 pm
ProfitPlot
Many thanks for these indis Rene - very useful.
With regard to the EquityMonitor - in fact you are no longer restricted to 8 buffers in Empty4. You can now have up to 512, for what its worth!
This is definitely a big improvement, especially for indis like currency strength meters where there is a lot of data to display, and it could be of use here..
With regard to the EquityMonitor - in fact you are no longer restricted to 8 buffers in Empty4. You can now have up to 512, for what its worth!
This is definitely a big improvement, especially for indis like currency strength meters where there is a lot of data to display, and it could be of use here..