Xauusd Forex Trader
1 subscriber
Smart Chart FX
Where smart traders meet smart charts. ๐Ÿ“Š
Get step-by-step forex tutorials, live chart analysis, and real
Download Telegram
Channel created
Channel photo updated
//+------------------------------------------------------------------+ //| XAUUSD Scalper EA (Prop-Firm Safe) | //| Timeframes: M5 / M15 | //| Risk-controlled, stacking allowed | //+------------------------------------------------------------------+ #property strict

input double LotSize = 0.05; input int MaxTrades = 5; input int StopLossPips = 20; input int TakeProfitPips = 20; input int MagicNumber = 777;

input int FastEMA = 50; input int SlowEMA = 200;

//--- Globals int tradeCount = 0;

bool SellBias() { double emaFast = iMA(_Symbol, PERIOD_M15, FastEMA, 0, MODE_EMA, PRICE_CLOSE, 0); double emaSlow = iMA(_Symbol, PERIOD_M15, SlowEMA, 0, MODE_EMA, PRICE_CLOSE, 0); return (emaFast < emaSlow); }

bool BuyBias() { double emaFast = iMA(_Symbol, PERIOD_M15, FastEMA, 0, MODE_EMA, PRICE_CLOSE, 0); double emaSlow = iMA(_Symbol, PERIOD_M15, SlowEMA, 0, MODE_EMA, PRICE_CLOSE, 0); return (emaFast > emaSlow); }

int CountOpenTrades() { int count = 0; for(int i=0; i<PositionsTotal(); i++) { if(PositionGetSymbol(i) == _Symbol && PositionGetInteger(POSITION_MAGIC) == MagicNumber) count++; } return count; }

void OnTick() { if(CountOpenTrades() >= MaxTrades) return;

double price = SymbolInfoDouble(_Symbol, SYMBOL_BID);

if(SellBias()) { trade.Sell(LotSize, _Symbol, price, price + StopLossPips * _Point, price - TakeProfitPips * _Point, "XAU Sell"); }

if(BuyBias()) { trade.Buy(LotSize, _Symbol, price, price - StopLossPips * _Point, price + TakeProfitPips * _Point, "XAU Buy"); } } //+------------------------------------------------------------------+
Channel name was changed to ยซXauusd Forex Traderยป