Unisciti alla nostra fan page
- Visualizzazioni:
- 4292
- Valutazioni:
- Pubblicato:
- 2024.10.20 19:27
- Aggiornato:
- 2025.01.29 14:53
-
Hai bisogno di un robot o indicatore basato su questo codice? Ordinalo su Freelance Vai a Freelance
The purpose of this code is to convey an idea to people seeking simple and functional approach to converting pine script to MQL5.
Here is the pine script code:
//@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)

This code provides a simple function for sending push notifications to your mobile device whenever trades are opened or closed in MetaTrader 5. It's designed for netting accounts (where only one position per symbol is allowed).

This MQL5 script exports candlestick data for various timeframes into a CSV file, capturing essential market information like open, high, low, and close prices. It analyzes each candlestick's characteristics, including body and wick sizes, while calculating additional metrics such as candle gaps. After processing the latest 21 bars, it notifies the user upon successful data export.

This script saves a predefined set of economic events from the MetaTrader's built-in economic calendar into CSV file.

This service periodically checks swaps for predefined symbols and saves detected changes into CSV-files for further analysis and potential replay (not implemented here). Also it monitors and alerts swap changes of existing positions.