Print history trades with an MFE and MAE info on chart

Техническое задание

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.

ToDo


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

Откликнулись

1
Разработчик 1
Оценка
Проекты
0
0%
Арбитраж
0
Просрочено
0
Свободен
2
Разработчик 2
Оценка
(9)
Проекты
19
16%
Арбитраж
3
67% / 0%
Просрочено
0
Свободен
3
Разработчик 3
Оценка
(588)
Проекты
1061
50%
Арбитраж
39
28% / 41%
Просрочено
49
5%
Работает
Опубликовал: 1 статью, 8 примеров
4
Разработчик 4
Оценка
(7)
Проекты
8
50%
Арбитраж
0
Просрочено
0
Свободен
Опубликовал: 1 пример
5
Разработчик 5
Оценка
(462)
Проекты
483
75%
Арбитраж
5
80% / 0%
Просрочено
0
Работает

Информация о проекте

Бюджет
40+ USD
Сроки выполнения
от 0 до 1 дн.