Specification
I need a simple indicator, resp. script which would display list of all closed historical trades and for each trade displays also maximum displayed values of potential profit (MFE) and potential loss (MAE) information on chart.
This could be displayed similiar as ZigZag indicator, but plus text label at top/bottom of each peak.
For displaying historical trades I already have script, which could be customized.
I need to add there a section which goes in simple loop through the ALL bars between closed trade and calculates/identifies TOP and BOTTOM bar.
Then print points/pips difference from a trade entry price above/below bar.
Please see black sections on below picture.
Contact me for details.
More info about calculation:
Example.
I have a DAX trade opened a BUY at 12:00 at price 12700
Assume we are on let's say 5 min chart and prices goes like:
BAR at time 12.05 - High 12715, Low 12690
BAR at time 12.10 - High 12723, Low 12701
BAR at time 12.15 - High 12726, Low 12709
BAR at time 12.20 - High 12718, Low 12695
BAR at time 12.25 - High 12710, Low 12672
BAR at time 12.30 - High 12694, Low 12681
BAR at time 12.35 - High 12702, Low 12685
I close this example trade at time 12.37 at the price 12703
In above scenario, a MFE (or TOP in case we are long, or we can say a how much points a position was in it's profit) would be a high price at time 12.15 when price was 12726. So in this case above this bar I would like to print number 26 (as a result of 12726 - 12700).
Similar MAE (or if we are long then BOTTOM or a price when was a maximal open loss) would be at a time 12.25 when low price was 12672. So in this case below this bar I would like to print number -28 (as a result of 12672 - 12700).
Do you understand what I mean?
Thanks,
Tomas
Tom