Pine script v2 to MQ4L Pivot point calculation with entry,exit,close, profits in ticks

2020.03.26 Indicators Converting

Job finished

Execution time 53 minutes
Feedback from customer
Did what I asked for
Feedback from employee
Many thanks!

Specification

Hey,

I would like to convert my old Forex script in pine v2 to MQ4L so i can test this strategy in strategy tester in MT4 and maybe later try automated trading. Correct me if the desired file format mq4 is not fit for this.

Code includes (D,W) Pivot point calculations in multiple periods, entry/exit/profit conditions, plotting some of the pivot points, highlighting some of the plotting points, alerts (if MQL4 allows them in same file).

I would like it to written as "simple" as possible (similar to pine/dummy style, because i'm a tester not a programmer) and such as mentioned above should be easily changed;

periods of PP's, entry, exits and alerts and so on. Should include graphical panel for these and entry/exit arrows too.

It is watched mostly in 1H charts but should work 15m, 30m and 2h charts too.

Overall lenght is under ~200 lines, some of the lines are unusable and unnecessary etc.

Here's some code of the out of contex:


WmHigh  = security(tickerid,"W", high[1])

WmHigh  = security(tickerid,"W", high[0]) ..-> these [0] period pivot would move due to price action as horizontal line

WsHigh  = security(tickerid,"W", high[2])

price_60_close = security(tickerid,"60", close)

long_formation_M = MxvPP > MPP and MPP > MvPP

long_entry = price_60 < PP and price_60 >= vPP

stoploss_short = input(1200, title='Stop Loss in Ticks', type=integer)

plot(cvPP, color=#FFEB3B, title="cvPP", style = line, linewidth = width3)

color_action = iff(long_form_sum and long_entry, #00E676, iff(short_form_sum and short_entry, #FF5252, iff(long_form_sum, #FFEB3B, iff(short_form_sum, #DC22F5, na))))

plot(PP, color=color_action, title="PP", style = line, linewidth = width1)

if long_form and long_form_M
    
    strategy.entry("BUY", strategy.long, 10000.0, when = long_entry)

short_alert = short_form and short_form_M and short_entry
alertcondition(short_alert, "SHORT!","SHORT!") 

Responded

1
Developer 1
2020.03.26
Rating
4.97
(569)
Projects
1154
65%
Arbitration
81
25% / 49%
Overdue
406
35%
Working
2
Developer 2
2020.03.26
Rating
4.83
(36)
Projects
54
24%
Arbitration
15
27% / 40%
Overdue
14
26%
Loaded
3
Developer 3
2020.03.26
Rating
4.83
(379)
Projects
677
49%
Arbitration
220
55% / 27%
Overdue
139
21%
Loaded
4
Developer 4
2020.03.26
Rating
4.92
(333)
Projects
517
41%
Arbitration
32
25% / 47%
Overdue
47
9%
Working
5
Developer 5
2020.03.26
Rating
5
(50)
Projects
60
55%
Arbitration
11
0% / 82%
Overdue
17
28%
Busy

Project information

Budget
40 - 85 USD
VAT (24%): 9.6 - 20.4 USD
Total: 49.6 - 105.4 USD
For the developer
36 - 76.5 USD
Deadlines
from 1 to 2 day(s)