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

Breakeven and R-Trail Manager — break-even at +1R and R-multiple trailing for any trade - MetaTrader 5용 expert

Shipra Gupta
Shipra Gupta
저는 Shipra Gupta이며, 수학, 경제학 및 알고리즘 트레이딩 시스템 분야에 강력한 배경을 가진 트레이더이자 퀀트 전략 개발자입니다. 수년간 외환(Forex), 금, 지수, 원자재 및 암호화폐 시장 전반에서 활동하며 일관성, 정밀성 및 체계적인 실행을 목표로 한 데이터 기반 거래 전략 개발에 집중해 왔습니다.
조회수:
43
게시됨:
MQL5 프리랜스 이 코드를 기반으로 한 로봇이나 지표가 필요하신가요? 프리랜스로 주문하세요 프리랜스로 이동


Why manage in R

R is the initial stop distance of a trade. Settings in R mean the same thing on gold at $1,800 and at $4,500, on Bitcoin and on EURUSD. You set the rule once and it scales with every trade.

Effect of break-even


In the author's Bitcoin breakout tests, moving the stop to break-even at +1R was the most effective single change. The win rate rose from about 20% to about 50%, and the longest losing streak fell from 16–21 trades to 8–9. Many would-be losers became small scratch trades, and the big winners were not touched.

Logic


  1. When the manager first sees a position with a stop, it stores R = |open − SL| in a terminal global variable keyed by the ticket. The value survives terminal restarts and later stop changes.
  2. When the reference price reaches +BE R, the stop moves to entry ± Lock R.
  3. When it reaches +Trail start R, the stop trails Trail R behind the reference price.
  4. The stop only ever moves in the trade's favour.

The reference price is the close of the last completed bar of the chosen timeframe (default H1), which is how most backtests evaluate exits. It can also use the live bid/ask.

double gainR=(is_buy?px-open:open-px)/R; if(gainR>=InpBE_R) // break-even + lock new_sl=is_buy?MathMax(sl,open+InpLock_R*R):MathMin(sl,open-InpLock_R*R); if(InpTrailStartR>0 && gainR>=InpTrailStartR) // R trail new_sl=is_buy?MathMax(new_sl,px-InpTrail_R*R):MathMin(new_sl,px+InpTrail_R*R);

Inputs

Input Default Description
Magic filter −1 −1 all trades, 0 manual only, or one magic number
Only chart symbol true Restrict to the chart symbol
Break-even trigger 1.0 R Distance that triggers break-even
Locked profit 0.1 R Profit locked at break-even
Trail start 2.0 R 0 = no trailing
Trail distance 2.0 R Distance behind price
Closed bars only true Evaluate once per bar
Bar timeframe H1 Timeframe for the closed-bar check

Safety

  • Positions without a stop are ignored, because R cannot be defined.
  • Stops level and freeze level are checked before every change, prices are rounded to the tick size, and unchanged stops are never sent (no error 10025).
  • Global variables of closed positions are cleaned every 30 seconds.

Author: Shipra Gupta (SGupta30) · the author's gold and Bitcoin EAs include break-even and R-based exits built in.


ATR Trailing Stop Line (Chandelier Exit) ATR Trailing Stop Line (Chandelier Exit)

ATR Trailing Stop Line (Chandelier Exit): a volatility-based trailing stop that hangs below the highest high in an up-trend and rises above the lowest low in a down-trend, with trend-flip arrows, an on-chart status label and optional alerts.

Kaufman Adaptive Moving Average (KAMA) Ribbon Kaufman Adaptive Moving Average (KAMA) Ribbon

A ribbon of Kaufman Adaptive Moving Averages with growing Efficiency Ratio periods, drawn in a monochrome gradient, with an on-chart label showing whether the ribbon is bullish, bearish or mixed.

MTF Trend Dashboard — trend, position and volatility on six timeframes at a glance MTF Trend Dashboard — trend, position and volatility on six timeframes at a glance

One on-chart table for M15, H1, H4, D1, W1 and MN1: EMA slope, price vs EMA, Donchian position, ATR percentile and a combined UP / DOWN / RANGE regime. Completed bars only. Any symbol.

Range Filter Buy and Sell for MT5 - faithful port with signal statistics, alerts and session filter Range Filter Buy and Sell for MT5 - faithful port with signal statistics, alerts and session filter

A faithful MetaTrader 5 port of the TradingView "Range Filter Buy and Sell 5min" (DonovanWall / guikroth / tvenn): range filter line, target bands, Buy/Sell arrows and bar colors, no repainting, alerts (popup, sound, push, e-mail) and a signal statistics panel.