거래 로봇을 무료로 다운로드 하는 법을 시청해보세요
당사를 Telegram에서 찾아주십시오!
당사 팬 페이지에 가입하십시오
스크립트가 흥미로우신가요?
그렇다면 링크 to it -
하셔서 다른 이들이 평가할 수 있도록 해보세요
스크립트가 마음에 드시나요? MetaTrader 5 터미널에서 시도해보십시오
지표

ATR Trailing Stop (Pine Script Port) - MetaTrader 5용 지표

Usama Bin Islam
Usama Bin Islam
MQL5 developer: Expert Advisors from written rules, indicator development, Pine Script to MQL5 conversions, and cost-aware backtesting.
How I work:
- I turn your rules into a short written spec (entries, exits, stops, sizing, filters) before writing any code, so we agree on the logic first.
조회수:
152
게시됨:
MQL5 프리랜스 이 코드를 기반으로 한 로봇이나 지표가 필요하신가요? 프리랜스로 주문하세요 프리랜스로 이동

ATR Trailing Stop (Pine Script port)


A worked example of converting a TradingView Pine Script indicator to MQL5, kept in parity with a Python reference implementation.


Rules (same in all three versions):

- nLoss = ATR multiplier x SMA of true range over InpATRLength bars

- The stop ratchets up under price while price stays above it, and down over price while price stays below it

- The stop flips to the other side, and an arrow is drawn, when price closes through it


Pine to MQL5/Python translation notes (the actual porting work):

- ta.tr(true): the first bar has no previous close, so true range there is just high minus low

- ta.sma(x, n): stays na until n bars exist (first valid value at bar n-1)

- nz(stop[1], src): the previous stop, or the current price while the previous stop is still na

- var float stop = na: state carried from bar to bar, translated to a persistent buffer in MQL5 and a running array in Python

- ta.crossover / ta.crossunder: strictly false while either side is na, which matters for the first valid bar


Repository (Pine source, Python port with a literal bar-by-bar reference implementation for cross-checking, and a parity test comparing both to the MQL5 output): github.com/RAo797bit/pine-python-mql5-conversion


Compiles clean in MetaEditor with 0 errors, 0 warnings ATR trailing stop on a synthetic price series.

EMA Cross Demo EA with ATR Stops EMA Cross Demo EA with ATR Stops

A small demo Expert Advisor: EMA fast/slow cross entries (evaluated on closed bars only, no repainting), ATR-based stop-loss and take-profit, spread filter, and position handling that works on both hedging and netting accounts. Includes a Python reference implementation for parity testing. This is a deliverable example, not a trading recommendation - the attached equity curve is from synthetic data and shows the method, not an edge.

Session TWAP: time weighted average price from the cash open, with deviation bands Session TWAP: time weighted average price from the cash open, with deviation bands

Time weighted average price of the running session, anchored at the cash open of Frankfurt, London, New York or Tokyo with automatic daylight saving. Every second counts the same, minutes without a tick carry the last price, and two bands show the time weighted standard deviation around the line.

Trade Reporter Lite - Telegram trade notifications Trade Reporter Lite - Telegram trade notifications

Posts your MT5 opens and closes to a Telegram chat: side, symbol, entry, stop and target in pips, lots, and on close the result, pips, R-multiple and time held. Retry queue, restart-safe, never trades. Free version of Trade Reporter Telegram and Discord.

CME Gap Tracker for Gold and Bitcoin: Open Gaps, Fill Rate and a Fade-Trade Test CME Gap Tracker for Gold and Bitcoin: Open Gaps, Fill Rate and a Fade-Trade Test

Finds the weekend CME gap on gold and on 24/7 Bitcoin charts, keeps every unfilled gap on the chart until price returns to it, and shows how often gaps filled, how fast, how far price ran first, and what fading them would have made. Non-repainting, with buffers for an Expert Advisor.