Fan sayfamıza katılın
- Görüntülemeler:
- 13
- Derecelendirme:
- Yayınlandı:
- Güncellendi:
-
Bu koda dayalı bir robota veya göstergeye mi ihtiyacınız var? Freelance üzerinden sipariş edin Freelance'e git
NE BASAR
--- 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); }
Zaten yasal olan bir durak değişmeden geri gelir, bu nedenle her durağı bu duraktan geçirecek şekilde rota oluşturmak güvenlidir. Mevcut hesaplamanızı sarmak için tek bir satır yeterlidir:
double sl = LegalStopLoss(_Symbol, true, ask, ask - atr * 1.5);
ÇIKTININ OKUNMASI İLE İLGİLİ NOTLAR
Semboller Market Watch'ta bulunmalı ve en az bir tick almış olmalıdır. Bir sembol için tick verisi yoksa, grafiğini bir kez açıp işlemi tekrar çalıştırın.
MetaQuotes Ltd tarafından İngilizceden çevrilmiştir.
Orijinal kod: 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
Eğime göre renk değiştiren ve fiyat ile ortalamanın kesişme noktalarını oklarla işaretleyen iki aşamalı uyarlanabilir hareketli ortalama (temel ortalama + ikincil düzeltme).
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.
