Converting Tradinview indicator to Mql5 to use by i Costum Fontion

MQL5 統合

仕事が完了した

実行時間8 分
依頼者からのフィードバック
Job Completed on Time thank you for nive servis

指定

Converting Tradinview indicator to Mql5 to use by i Costum  Fontion mql5 should be 2 idnicator open course on tradinvgcview


//@version=2

study(title = "Smoothed Heiken Ashi Candles", shorttitle="Smoothed Ha Candles", overlay=true)

len=input(10)
o=ema(open,len)
c=ema(close,len)
h=ema(high,len)
l=ema(low,len)

haclose = (o+h+l+c)/4
haopen = na(haopen[1]) ? (o + c)/2 : (haopen[1] + haclose[1]) / 2
hahigh = max (h, max(haopen,haclose))
halow = min (l, min(haopen,haclose))

len2=input(10)
o2=ema(haopen, len2)
c2=ema(haclose, len2)
h2=ema(hahigh, len2)
l2=ema(halow, len2)

col=o2>c2 ? red : lime

plotcandle(o2, h2, l2, c2, title="heikin smoothed", color=col)



Second Indıcator 



// This work is licensed under Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International  
// © BigBeluga

//@version=5
indicator("Target Trend [BigBeluga]", overlay = true, max_lines_count = 40)

// INPUTS ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――{
length = input.int(10, "Trend Length")
target = input.int(0, "Set Targets")
// }


// VARIABLES ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――{
var bool trend    = na
float trend_value = na

// Colors
color up_color = #06b690
color dn_color = color.rgb(182, 112, 6)

// ATR for calculating stop loss and target levels
series float atr_value = ta.sma(ta.atr(200), 200) * 0.8

// Moving averages for trend detection
series float sma_high  = ta.sma(high, length) + atr_value
series float sma_low   = ta.sma(low, length) - atr_value
color       plot_color = color.new(chart.fg_color, 80)

// UDT for managing lines and labels
type TrendTargets
    line[] lines
    label[] labels

// Initialize UDT
var TrendTargets targets_up   = TrendTargets.new(array.new_line(), array.new_label())
var TrendTargets targets_down = TrendTargets.new(array.new_line(), array.new_label())
// }


// CALCULATIONS――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――{
 
// Determine trend based on crossovers
if ta.crossover(close, sma_high) and barstate.isconfirmed
    trend := true
if ta.crossunder(close, sma_low) and barstate.isconfirmed
    trend := false

trend_value := switch
    trend     => sma_low
    not trend => sma_high

trend_color = trend ? up_color : not trend ? dn_color : na


// Signal detection for trend changes
bool signal_up   = ta.change(trend) and not trend[1]
bool signal_down = ta.change(trend) and trend[1]


// Method to draw trend targets and manage lines/labels
method draw_targets(TrendTargets targets, bool signal1, bool signal2, bool direction)=>
    float base           = direction ? sma_low : sma_high
    float atr_multiplier = atr_value * (direction ? 1 : -1)

    // Reset counters for up and down targets
    var int count_up   = 0
    var int count_down = 0

    if trend
        count_down := 0
        count_up += 1
    if not trend
        count_down += 1
        count_up := 0

    int count = direction ? count_up : count_down

    if signal1
        float target_len1 = atr_multiplier * (5+target)
        float target_len2 = atr_multiplier * (10+target*2)
        float target_len3 = atr_multiplier * (15+target*3)
               
        // Clear existing lines and labels
        for line_i in targets.lines
            int i = targets.lines.indexof(line_i)
            label.delete(targets.labels.get(i))
            line.delete(line_i)

        array.clear(targets.lines)
        array.clear(targets.labels)

        // Draw new lines for trend targets
        line stop_loss_line = line.new(bar_index, base, bar_index + 20, base)
        line entry_line     = line.new(bar_index, close, bar_index + 20, close)
        line target1_line   = line.new(bar_index, close + target_len1, bar_index + 20, close + target_len1)
        line target2_line   = line.new(bar_index, close + target_len2, bar_index + 20, close + target_len2)
        line target3_line   = line.new(bar_index, close + target_len3, bar_index + 20, close + target_len3)

        // Fill between stop loss and entry line
        linefill.new(stop_loss_line, entry_line, color.new(dn_color, 95))
        linefill.new(entry_line, target3_line, color.new(up_color, 95))

        // Draw new labels for trend targets
        label stop_loss_label = label.new(bar_index + 20, base, str.tostring(math.round(base, 2)))
        label entry_label     = label.new(bar_index + 20, close, str.tostring(math.round(close, 2)))
        label target1_label   = label.new(bar_index + 20, close + target_len1, "1 - " + str.tostring(math.round(close + target_len1, 2)))
        label target2_label   = label.new(bar_index + 20, close + target_len2, "2 - " + str.tostring(math.round(close + target_len2, 2)))
        label target3_label   = label.new(bar_index + 20, close + target_len3, "3 - " + str.tostring(math.round(close + target_len3, 2)))

        // Push lines and labels to the UDT
        targets.lines.push(stop_loss_line)
        targets.lines.push(entry_line)
        targets.lines.push(target1_line)
        targets.lines.push(target2_line)
        targets.lines.push(target3_line)

        targets.labels.push(stop_loss_label)
        targets.labels.push(entry_label)
        targets.labels.push(target1_label)
        targets.labels.push(target2_label)
        targets.labels.push(target3_label)

        // Update styles for labels and lines
        for lbl in targets.labels
            int  idx      = targets.labels.indexof(lbl)
            line line_ref = targets.lines.get(idx)
            lbl.set_style(label.style_label_left)
            lbl.set_color(chart.fg_color)
            lbl.set_textcolor(chart.bg_color)
            line_ref.set_color(chart.fg_color)

    if signal2
        // Clear existing lines and labels
        for line_i in targets.lines
            int i = targets.lines.indexof(line_i)
            label.delete(targets.labels.get(i))
            line.delete(line_i)

        array.clear(targets.lines)
        array.clear(targets.labels)

    for line_i in targets.lines
        int   idx           = targets.lines.indexof(line_i)
        label lbl_ref       = targets.labels.get(idx)
        label first_label   = targets.labels.first()
        line  entry_line    = targets.lines.get(1)
        label entry_label   = targets.labels.get(1)

        // Targets
        if high >= line.get_y2(line_i) and low <= line.get_y2(line_i) and count > 1
            lbl_ref.set_style(label.style_label_left)
            lbl_ref.set_color(chart.fg_color)
            lbl_ref.set_text("   ✔   ")
            lbl_ref.set_textcolor(#16ac09)
            line_i.set_style(line.style_dashed)
            line_i.set_color(plot_color)

        // Stop Loss
        if high >= line.get_y2(targets.lines.first()) and low <= line.get_y2(targets.lines.first()) and count > 1
            first_label.set_text("  ✖  ")

        if direction ? trend : not trend
            first_label.set_textcolor(#db1e1e)
            line_i.set_x2(bar_index + 20)
            targets.lines.first().set_color(#db1e1e)
           
            label.set_x(targets.labels.get(idx), bar_index + 20)

            entry_line.set_style(line.style_solid)
            entry_line.set_color(up_color)
            entry_label.set_text("◉ " + str.tostring(math.round(line.get_y2(entry_line), 2)))
            entry_label.set_textcolor(#1d80dd)
// }

// PLOT―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――{
// Call the draw_targets method for both upward and downward trends
targets_down.draw_targets(signal_down, signal_up, false)
targets_up.draw_targets(signal_up, signal_down, true)

// Plot candlesticks with trend color
plotcandle(open, high, low, close,
           title = 'Title',
           color = trend_color,
           wickcolor = trend_color,
           bordercolor = trend_color)

// Plot trailing stops
p1 = plot(trend ? trend_value : na, style = plot.style_linebr, color = plot_color)
p2 = plot(not trend ? trend_value : na, style = plot.style_linebr, color = plot_color)
p0 = plot(hl2, display = display.none, editable = false)
fill(p1, p0, trend_value, hl2, color.new(chart.fg_color, 90), na)
fill(p2, p0, trend_value, hl2, color.new(chart.fg_color, 90), na)

// Plot signals on the chart
float sigUp = signal_up ? low - atr_value*2 : na
float sigDn = signal_down ? high + atr_value*2 : na

plotshape(sigUp,   "", shape.triangleup, location.absolute, up_color, size = size.tiny)
plotshape(sigUp,   "", shape.triangleup, location.absolute, color.new(up_color, 80), size = size.small)

plotshape(sigDn, "", shape.triangledown, location.absolute, dn_color, size = size.tiny)
plotshape(sigDn, "", shape.triangledown, location.absolute, color.new(dn_color, 80), size = size.small)

// }



応答済み

1
開発者 1
評価
(21)
プロジェクト
28
4%
仲裁
4
25% / 0%
期限切れ
3
11%
仕事中
2
開発者 2
評価
(70)
プロジェクト
99
52%
仲裁
24
21% / 54%
期限切れ
8
8%
仕事中
3
開発者 3
評価
(250)
プロジェクト
460
26%
仲裁
140
20% / 59%
期限切れ
100
22%
仕事中
4
開発者 4
評価
(12)
プロジェクト
24
50%
仲裁
1
100% / 0%
期限切れ
6
25%
5
開発者 5
評価
プロジェクト
0
0%
仲裁
0
期限切れ
0
6
開発者 6
評価
(5)
プロジェクト
5
60%
仲裁
0
期限切れ
0
7
開発者 7
評価
(265)
プロジェクト
596
35%
仲裁
64
20% / 58%
期限切れ
147
25%
仕事中
パブリッシュした人: 1 article, 22 codes
8
開発者 8
評価
(120)
プロジェクト
128
36%
仲裁
3
33% / 33%
期限切れ
2
2%
取り込み中
9
開発者 9
評価
(390)
プロジェクト
416
30%
仲裁
74
19% / 70%
期限切れ
52
13%
仕事中
10
開発者 10
評価
(452)
プロジェクト
564
26%
仲裁
24
42% / 38%
期限切れ
85
15%
仕事中
パブリッシュした人: 6 codes
11
開発者 11
評価
(1)
プロジェクト
1
0%
仲裁
0
期限切れ
0
12
開発者 12
評価
プロジェクト
0
0%
仲裁
0
期限切れ
0
13
開発者 13
評価
(70)
プロジェクト
91
25%
仲裁
26
19% / 54%
期限切れ
25
27%
14
開発者 14
評価
(2)
プロジェクト
2
0%
仲裁
3
0% / 100%
期限切れ
1
50%
15
開発者 15
評価
(294)
プロジェクト
470
39%
仲裁
102
40% / 24%
期限切れ
78
17%
多忙
パブリッシュした人: 2 codes
16
開発者 16
評価
プロジェクト
0
0%
仲裁
0
期限切れ
0
17
開発者 17
評価
(159)
プロジェクト
215
76%
仲裁
4
50% / 25%
期限切れ
18
8%
パブリッシュした人: 2 articles
18
開発者 18
評価
(39)
プロジェクト
54
61%
仲裁
2
50% / 50%
期限切れ
0
19
開発者 19
評価
(4)
プロジェクト
7
0%
仲裁
3
33% / 33%
期限切れ
3
43%
取り込み中
類似した注文
I have an MT5 expert advisor. The EA trades martingale strategy. I need it converted to a python bot to trade futures in binance, bybit, okx, kucoin and other dexes

プロジェクト情報

予算
30 - 50 USD