Convert Pine Script to MT5 EA and add some features

Specifiche

Convert the below code to an MT5 EA: 


//@version=4

strategy("Volty Expan Close Strategy", overlay=true)

length = input(11)

numATRs = input(0.55)


atrs = sma(tr, length)*numATRs


if (not na(close[length]))

    strategy.entry("VltClsLE", strategy.long, stop=close+atrs, comment = "VltClsLE")

    strategy.entry("VltClsSE", strategy.short, stop=close-atrs, comment = "VltClsSE")


//plot(strategy.equity, title="equity", color=color.red, linewidth=2, style=plot.style_areabr)


And add some additional features:

  • Stop Loss,
  • Trailing Stop (with trailing start, trailing distance, and trailing step)
  • option to close on opposite signal, true or false
  • If the strategy is in a buy signal, once the initial buy trade closes, place a buy stop order X points (the Offset) above the current price. The Offset amount should be an input parameter
    • The buy stop order should follow the market price. So let's say the first buy trade closes at 5500.00. If the Offset is set to 200 points, a new buy stop order is placed at 5502.00. but if the price falls to 5499.00, the buy stop order should move down to 5501.00. but it should never move back up. Apply the same logic to the sell side.
  • There should only be one trade open per direction at any time. but a buy and sell trade can exist simultaneously (if close on opposite signal is set to false), if a sell signal is triggered while a buy trade is still open, and vice versa.
  • Essentially, i am asking you to recreate an already existing EA (.ex4 file only, no source file) which i will send to you in a private discussion, but have it only enter buy trades when the above Pine Script strategy is in a buy signal, and only enter sell trades when it is in a sell signal. It basically just needs to be modified so that it determines buy/sells according to the above strategy, instead of its existing strategy, which tends to always be trading against the trend.




Con risposta

1
Sviluppatore 1
Valutazioni
(1)
Progetti
0
0%
Arbitraggio
2
0% / 100%
In ritardo
0
Gratuito
2
Sviluppatore 2
Valutazioni
Progetti
0
0%
Arbitraggio
0
In ritardo
0
Gratuito
3
Sviluppatore 3
Valutazioni
Progetti
1
0%
Arbitraggio
1
0% / 0%
In ritardo
0
Gratuito
4
Sviluppatore 4
Valutazioni
(206)
Progetti
333
35%
Arbitraggio
66
12% / 58%
In ritardo
87
26%
Gratuito
5
Sviluppatore 5
Valutazioni
(2)
Progetti
3
0%
Arbitraggio
1
0% / 100%
In ritardo
0
In elaborazione
6
Sviluppatore 6
Valutazioni
(1)
Progetti
2
0%
Arbitraggio
1
0% / 100%
In ritardo
0
Gratuito
Pubblicati: 2 codici
7
Sviluppatore 7
Valutazioni
Progetti
1
0%
Arbitraggio
0
In ritardo
0
In elaborazione
8
Sviluppatore 8
Valutazioni
(845)
Progetti
1447
72%
Arbitraggio
119
29% / 47%
In ritardo
355
25%
In elaborazione
Pubblicati: 3 articoli
9
Sviluppatore 9
Valutazioni
(27)
Progetti
38
24%
Arbitraggio
14
0% / 93%
In ritardo
4
11%
In elaborazione
10
Sviluppatore 10
Valutazioni
Progetti
0
0%
Arbitraggio
0
In ritardo
0
Gratuito
11
Sviluppatore 11
Valutazioni
Progetti
0
0%
Arbitraggio
1
0% / 100%
In ritardo
0
Gratuito
12
Sviluppatore 12
Valutazioni
Progetti
0
0%
Arbitraggio
0
In ritardo
0
Gratuito
13
Sviluppatore 13
Valutazioni
(337)
Progetti
624
38%
Arbitraggio
40
23% / 65%
In ritardo
93
15%
Gratuito
Pubblicati: 4 articoli, 19 codici
14
Sviluppatore 14
Valutazioni
(120)
Progetti
128
36%
Arbitraggio
3
33% / 33%
In ritardo
2
2%
Caricato
15
Sviluppatore 15
Valutazioni
(275)
Progetti
370
72%
Arbitraggio
18
33% / 44%
In ritardo
14
4%
Gratuito
Pubblicati: 14 codici
16
Sviluppatore 16
Valutazioni
(15)
Progetti
21
38%
Arbitraggio
6
33% / 50%
In ritardo
0
In elaborazione
17
Sviluppatore 17
Valutazioni
(10)
Progetti
10
10%
Arbitraggio
0
In ritardo
2
20%
In elaborazione
18
Sviluppatore 18
Valutazioni
(1)
Progetti
2
0%
Arbitraggio
2
0% / 0%
In ritardo
0
Caricato
19
Sviluppatore 19
Valutazioni
(27)
Progetti
26
65%
Arbitraggio
0
In ritardo
1
4%
Caricato
Pubblicati: 5 codici
20
Sviluppatore 20
Valutazioni
(1)
Progetti
2
0%
Arbitraggio
0
In ritardo
1
50%
Gratuito
21
Sviluppatore 21
Valutazioni
(14)
Progetti
14
21%
Arbitraggio
0
In ritardo
0
Gratuito
22
Sviluppatore 22
Valutazioni
(294)
Progetti
470
39%
Arbitraggio
102
40% / 24%
In ritardo
78
17%
Occupato
Pubblicati: 2 codici

Informazioni sul progetto

Budget
30+ USD

Cliente

(2)
Ordini effettuati9
Numero di arbitraggi0