Pine Code into the MQL4

MQL4 전환

작업 종료됨

실행 시간 3 일
고객의 피드백
Great work. Just in time as promised.
피고용인의 피드백
He is a good and kind customer.

명시

I want to use the pine code below as an MT4 or MT5 EA. Additioanly I need alerts when enter a trade . When close long open short and same for the reverse. Just like in the pine strategy tester area it should be always in a trade. 
I am aware of the feed changes can effect the entry and exit points but the code should work with same consistancy on Metatrader. Thanks in advance.
strategy("Forex Capraz", overlay=true)

fark = input(title="pip farkı", type=input.integer, defval=320)
length = input(title="ATR Period", type=input.integer, defval=22)
mult = input(title="ATR Multiplier", type=input.float, step=0.1, defval=3.0)
wicks = input(title="Take Wicks into Account ?", type=input.bool, defval=false)
showLabels = input(title="Show Buy/Sell Labels ?", type=input.bool, defval=true)
highlightState = input(title="Highlight State ?", type=input.bool, defval=true)

atr = mult * atr(length) 

longStop = hl2 - atr
longStopPrev = nz(longStop[1], longStop)
longStop := (wicks ? low[1] : close[1]) > longStopPrev ? max(longStop, longStopPrev) : longStop
longStop2 = longStop + (fark * syminfo.mintick)


shortStop = hl2 + atr 
shortStopPrev = nz(shortStop[1], shortStop)
shortStop := (wicks ? high[1] : close[1]) < shortStopPrev ? min(shortStop, shortStopPrev) : shortStop
shortStop2 = shortStop - (fark* syminfo.mintick)
dir = 1
dir := nz(dir[1], dir)
dir := dir == -1 and (wicks ? high : close) > shortStopPrev ? 1 : dir == 1 and (wicks ? low : close) < longStopPrev ? -1 : dir

longColor = color.green
shortColor = color.red
noneColor = color.new(color.white, 100)


strategy.entry(id="long",long =true, limit= shortStop2)
strategy.entry(id="short",long=false , limit = longStop2)

응답함

1
개발자 1
등급
(38)
프로젝트
50
10%
중재
1
0% / 0%
기한 초과
8
16%
무료
2
개발자 2
등급
(851)
프로젝트
1463
72%
중재
122
29% / 48%
기한 초과
358
24%
무료
게재됨: 3 기고글
3
개발자 3
등급
(132)
프로젝트
178
39%
중재
4
25% / 50%
기한 초과
14
8%
무료
4
개발자 4
등급
(14)
프로젝트
19
11%
중재
1
0% / 100%
기한 초과
5
26%
무료
5
개발자 5
등급
(412)
프로젝트
543
75%
중재
9
44% / 0%
기한 초과
24
4%
무료
6
개발자 6
등급
(214)
프로젝트
316
34%
중재
63
37% / 40%
기한 초과
102
32%
작업중
7
개발자 7
등급
(564)
프로젝트
845
73%
중재
15
53% / 13%
기한 초과
193
23%
무료

프로젝트 정보

예산
60 - 80 USD
기한
 5 일