Need very short Pine Script converted to MQL4.

MQL4 変換

仕事が完了した

実行時間2 時間
開発者からのフィードバック
Good customer. Fast payment and communication.
依頼者からのフィードバック
Yashar was the first developer that I have hired from MQL5 Freelance. He was fast, professional and very helpful. I would not hesitate to use his services in the future.

指定

Need the following Pine script converted to MQL4.

EDIT - Fill color is not needed.


EDIT - Desire output is shown in the attached PNG. (minus the color fill)

//@version=4
// Copyright (c) 2019-present, Alex Orekhov (everget)
// Parabolic SAR script may be freely distributed under the terms of the GPL-3.0 license.
study("Parabolic SAR", shorttitle="PSAR", overlay=true)

start = input(title="Start", type=input.float, step=0.001, defval=0.02)
increment = input(title="Increment", type=input.float, step=0.001, defval=0.02)
maximum = input(title="Maximum", type=input.float, step=0.01, defval=0.2)
width = input(title="Point Width", type=input.integer, minval=1, defval=2)
highlightStartPoints = input(title="Highlight Start Points ?", type=input.bool, defval=true)
showLabels = input(title="Show Buy/Sell Labels ?", type=input.bool, defval=true)
highlightState = input(title="Highlight State ?", type=input.bool, defval=true)

psar = sar(start, increment, maximum)
dir = psar < close ? 1 : -1

psarColor = dir == 1 ? #3388bb : #fdcc02
psarPlot = plot(psar, title="PSAR", style=plot.style_circles, linewidth=width, color=psarColor, transp=0)

var color longColor = color.green
var color shortColor = color.red

buySignal = dir == 1 and dir[1] == -1
plotshape(buySignal and highlightStartPoints ? psar : na, title="Long Start", location=location.absolute, style=shape.circle, size=size.tiny, color=longColor, transp=0)
plotshape(buySignal and showLabels ? psar : na, title="Buy Label", text="Buy", location=location.absolute, style=shape.labelup, size=size.tiny, color=longColor, textcolor=color.white, transp=0)

sellSignal = dir == -1 and dir[1] == 1
plotshape(sellSignal and highlightStartPoints ? psar : na, title="Short Start", location=location.absolute, style=shape.circle, size=size.tiny, color=shortColor, transp=0)
plotshape(sellSignal and showLabels ? psar : na, title="Sell Label", text="Sell", location=location.absolute, style=shape.labeldown, size=size.tiny, color=shortColor, textcolor=color.white, transp=0)

midPricePlot = plot(ohlc4, title="", display=display.none)

fillColor = highlightState ? (dir == 1 ? longColor : shortColor) : na
fill(midPricePlot, psarPlot, title="Trade State Filling", color=fillColor)

changeCond = dir != dir[1]
alertcondition(changeCond, title="Alert: PSAR Direction Change", message="PSAR has changed direction!")
alertcondition(buySignal, title="Alert: PSAR Long", message="PSAR Long")
alertcondition(sellSignal, title="Alert: PSAR Short", message="PSAR Sell")


ファイル:

PNG
psar.png
29.3 Kb

応答済み

1
開発者 1
評価
(278)
プロジェクト
373
72%
仲裁
19
32% / 47%
期限切れ
14
4%
パブリッシュした人: 14 codes
2
開発者 2
評価
(54)
プロジェクト
53
17%
仲裁
7
0% / 100%
期限切れ
5
9%
3
開発者 3
評価
(94)
プロジェクト
190
66%
仲裁
8
25% / 50%
期限切れ
2
1%
4
開発者 4
評価
(849)
プロジェクト
1453
72%
仲裁
122
29% / 48%
期限切れ
355
24%
仕事中
パブリッシュした人: 3 articles
5
開発者 5
評価
(4)
プロジェクト
9
11%
仲裁
2
50% / 50%
期限切れ
0

プロジェクト情報

予算
30+ USD
締め切り
最低 1 最高 3 日