Topic: Feature Proposal: Histogram of Trades
I've found it very useful in researching strategies to include a histogram of the trades. I've got a prototype working on my local copy of FSB, and wanted to discuss if users think it is useful, and how it should be added to FSB to submit.
Here's a screenshot:
This is a random strategy, I just took the first couple of indicators, and bar closing to show how they plot. The equity curve shows the trades over time, and the histogram gives an idea of the distribution of trades.
The mouse over sends the detailed info to the status bar at the bottom. In the screenshot, I have my mouse on the trades that resulted in 0, so on the bottom you can see "Result: 0 Count: 169 Total: 0".
"Result" is trades that resulted in that amount; "Count" is how many, my strategy had 169 trades that resulted in $0; "Total" is the total amount from all trades at the result (or Result * Count).
In the upper left, it has a toggle button. I wanted to put it on the right, but had a bug with redrawing and Invalidate() I could not figure out, so left it on the left. It toggles to cumulative amount at that trade result, like in this screenshot:
Reds are losers and greens are winners. This view gives a better example of "Total" -- I have mouse over trades that resulted in profit of 10, and there 15 of them, so the Total is 150. The goal is to get a visual sense of the area under the curve of the losers vs winners, and a better idea of how the outliers affect the end result.
Questions on feature:
1) Where should the panel go? I have it over the Equity Chart on the Main work area, because I like to see it as I adjust parameters. Would it be better to have as a separate pop up panel, like the Comparator / Scanner / Analyzer features? Or to have it toggle out of sight like the Journal by Positions and Journal by Bars?
2) Are there better labels than "Result", "Count", "Total"?
3) How to export histogram data? For now, I have it as Right Click -- pops up Message Box, then I can copy and paste to somewhere. That was the simplest way to do it for the prototype.
4) Is there other useful info to add to the feature?
Bugs:
1) I modeled off the Small_Balance_Chart, but could not get the right axis correct. After minimizing / restoring, the right axis scale gets larger and larger numbers.
2) The toggle button is on left. If I resize FSB, it redraws the button several times across the title bar without removing the previous ones. I couldn't figure out how C# does that.
3) Rounding -- the trade results are rounded to the nearest integer. This means for a permanent stop set to 30, the stopped trades will plot as 32 and 33, unfortunately removing the visual sense of how many got stopped. It makes it look shorter since they are separated over 2-3 bars:
Same happens on the right for the Permanent Take Profit at 90 -- it has 2 bars for the limit trades at 86 and 87.
I am also ok if this is Fact of Life, probably not a big deal or bug.
__
Please feel free to comment with your ideas, this is in the prototype stage so suggestions or changes can be put in fairly easily, and it will help to get everyone to agree on the how the final feature should look and work.
I think this feature is useful because you can see the distribution, it gives a visual sense of how random a strategy is, and where it is centered. It also gives an idea if your strategy has fat tails or not, and really helps show that sometimes just a few positive outliers account for all the profit of a strategy, the rest mostly balance out.