당사 팬 페이지에 가입하십시오
- 조회수:
- 16
- 평가:
- 게시됨:
- 업데이트됨:
-
이 코드를 기반으로 한 로봇이나 지표가 필요하신가요? 프리랜스로 주문하세요 프리랜스로 이동
인쇄 내용
--- XAUUSD (bid 4402.15 / ask 4402.63) --------------------- stops level 350 pts | freeze level 0 pts | EFFECTIVE band 351 pts VERDICT: a stop/pending placed 100 pts from price would be REJECTED as 'Invalid price' (band is 351 pts) buy at ask 4402.63: you asked SL 4401.63 -> nearest legal SL 4399.12 (moved out)
double MinStopDistance(const string sym) { long stops = SymbolInfoInteger(sym, SYMBOL_TRADE_STOPS_LEVEL); long freeze = SymbolInfoInteger(sym, SYMBOL_TRADE_FREEZE_LEVEL); long band = (stops > freeze ? stops : freeze) + 1; return band * SymbolInfoDouble(sym, SYMBOL_POINT); }
double LegalStopLoss(const string sym, const bool isBuy, const double price, const double wanted) { double dist = MinStopDistance(sym); int digits = (int)SymbolInfoInteger(sym, SYMBOL_DIGITS); double sl = wanted; if(isBuy) { if(price - sl < dist) sl = price - dist; } else { if(sl - price < dist) sl = price + dist; } return NormalizeDouble(sl, digits); }
이미 합법적인 정류장은 변경 없이 그대로 유지되므로, 모든 정류장을 이 정류장을 경유하도록 경로를 설정해도 안전합니다. 기존 계산을 감싸는 데는 한 줄만 추가하면 됩니다:
double sl = LegalStopLoss(_Symbol, true, ask, ask - atr * 1.5);
출력 결과 해석에 관한 참고 사항
종목은 ‘Market Watch’에 표시되어야 하며, 최소 한 번의 틱 데이터를 수신해야 합니다. 종목에 틱 데이터가 보고되지 않는 경우, 해당 차트를 한 번 열고 다시 실행하십시오.
MetaQuotes Ltd에서 영어로 번역함.
원본 코드: https://www.mql5.com/en/code/76178
Risk Guard — risk-based lot size, daily loss lock, max positions, oversized-trade trim, forced stop-loss
Enforces your own risk rules on every position, whether opened by hand or by another EA: shows the lot size that matches your risk, locks the account for the day after a set loss, caps open positions, trims positions that risk more than allowed, and adds a stop-loss to any position opened without one.
Prop-Firm Equity Guard - daily and max drawdown protection (FTMO-style)
Strict risk management utility for prop-firm challenges. Automatically monitors your entire account to prevent daily and max drawdown failures. It acts as a safety buffer against spread spikes and revenge trading by instantly closing all positions and pending orders before your evaluation is terminated.
Custom Simple Moving Average
기울기에 따라 색상이 변하고, 가격과 평균선의 교차 지점을 화살표로 표시하는 2단계 적응형 이동평균(기본 평균 + 2차 평활화)입니다.
Smart Loss Exit — early exit for losing positions (ATR adverse excursion, time in trade, EMA invalidation, RSI, money cap) with a CSV journal
Closes losing positions early, before the full stop-loss, when a rule says the trade is not coming back: adverse move beyond N x ATR, too long in loss, EMA trend flipped, RSI against the position, or a money cap. Never touches a position in profit. Observe-only mode journals what would be closed without closing anything. Every exit is written to CSV with the rule, the age and the maximum adverse excursion, so the rules can be tuned from data.
