Bu kodun amacı, pine script'i MQL5'e dönüştürmek için basit ve işlevsel bir yaklaşım arayan kişilere bir fikir iletmektir.
İşte pine script kodu:
//@version=5 indicator(title='sample stochastic divergence', overlay=true) stoch_len = input.int(title='stoch_len', defval=5) f_top_fractal(_src) => _src[4] < _src[2] and _src[3] < _src[2] and _src[2] > _src[1] and _src[2] > _src[0] f_bot_fractal(_src) => _src[4] > _src[2] and _src[3] > _src[2] and _src[2] < _src[1] and _src[2] < _src[0] f_fractalize(_src) => f_bot_fractal__1 = f_bot_fractal(_src) f_top_fractal(_src) ? 1 : f_bot_fractal__1 ? -1 : 0 stoch = ta.stoch(close, high, low, stoch_len) fractal_top = f_fractalize(stoch) > 0 ? stoch[2] : na fractal_bot = f_fractalize(stoch) < 0 ? stoch[2] : na high_prev = ta.valuewhen(fractal_top, stoch[2], 1) high_price = ta.valuewhen(fractal_top, high[2], 1) low_prev = ta.valuewhen(fractal_bot, stoch[2], 1) low_price = ta.valuewhen(fractal_bot, low[2], 1) regular_bearish_div = fractal_top and high[2] > high_price and stoch[2] < high_prev regular_bullish_div = fractal_bot and low[2] < low_price and stoch[2] > low_prev plot(title='H F', series=fractal_top ? high[2] : na, color=regular_bearish_div ? color.maroon : na, offset=-2) plot(title='L F', series=fractal_bot ? low[2] : na, color=regular_bullish_div ? color.green : na, offset=-2) plot(title='H D', series=fractal_top ? high[2] : na, style=plot.style_circles, color=regular_bearish_div ? color.maroon : na , linewidth=3, offset=-2) plot(title='L D', series=fractal_bot ? low[2] : na, style=plot.style_circles, color=regular_bullish_div ? color.green : na , linewidth=3, offset=-2) plotshape(title='+RBD', series=regular_bearish_div ? high[2] : na, text='R', style=shape.labeldown, location=location.absolute, color=color.maroon, textcolor=color.white, offset=-2) plotshape(title='-RBD', series=regular_bullish_div ? low[2] : na, text='R', style=shape.labelup, location=location.absolute, color=color.green, textcolor=color.white, offset=-2)
MetaQuotes Ltd tarafından İngilizceden çevrilmiştir.
Orijinal kod: /en/code/52935
Economic Calendar CSV
Bu komut dosyası, MetaTrader'ın yerleşik ekonomik takviminden önceden tanımlanmış bir dizi ekonomik olayı CSV dosyasına kaydeder.
Fisher CG Osilatörü
Fisher CG Osilatörü, değerleri kullanıcı tarafından tanımlanan CG Osilatörü göstergesinin değerlerinin Ters Fisher Dönüşümü (Inverse Fisher Transform) ile elde edilen bir osilatördür.
Fisher RVI
Fisher RVI, RVI (Relative Vigor Index) göstergesinin değerlerinin Ters Fisher Dönüşümü (Inverse Fisher Transform) ile elde edilen değerlere dayanan bir osilatördür.
Renkli Parabolik
Ergonomik Parabolic SAR. Sunulan göstergeye, her trend değişikliğinde ortaya çıkan büyük renkli noktalar eklenmiştir ve göstergenin kendisi iki renkli olarak tasarlanmıştır.