이 코드의 목적은 파인 스크립트를 MQL5로 변환하는 간단하고 기능적인 접근 방식을 찾는 사람들에게 아이디어를 전달하기 위한 것입니다.
다음은 파인 스크립트 코드입니다:
//@버전=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에서 영어로 번역함.
원본 코드: /en/code/52935
Economic Calendar CSV
이 스크립트는 메타트레이더에 내장된 경제 캘린더에서 미리 정의된 경제 이벤트 집합을 CSV 파일로 저장합니다.
피셔 CG 오실레이터
Fisher CG Oscillator는 사용자 지정 지표인 CG Oscillator의 값을 피셔 역변환(Inverse Fisher Transform)하여 산출되는 오실레이터입니다.
Fisher RVI
Fisher RVI는 RVI(Relative Vigor Index) 지표 값을 피셔 역변환(Inverse Fisher Transform)하여 산출되는 오실레이터입니다.
컬러 파라볼릭
사용자 친화적인 Parabolic SAR. 이 지표에는 추세 전환 시마다 나타나는 큰 색상 점들이 추가되었으며, 지표 자체는 두 가지 색상으로 구성되어 있습니다.