Alpha V2.0
Alpha V2.0
mqh>
CTrade trade;
// 📌 Input Settings
input double Risk_Percentage = 1.0; // % Risk per trade
input double Fixed_Lot = 0.1; // Fixed lot size
input bool Use_Fixed_Lot = false; // Use fixed lot instead of risk %
input string NFP_Direction = "NONE"; // Manual NFP input: "BUY", "SELL", "NONE"
// 📊 Indicator Functions
double GetSMA(int period, int shift) {
return iMA(Symbol(), 0, period, 0, MODE_SMA, PRICE_CLOSE, shift);
}
if (!allowTrade) return;
// 🔵 Buy Condition
if (smaFast > smaSlow && price > smaFast) {
double slPrice = Bid - stopLoss;
double tpPrice = Bid + takeProfit;
trade.Buy(lotSize, Symbol(), slPrice, tpPrice, 0, "Buy Order");
}
// 🔴 Sell Condition
if (smaFast < smaSlow && price < smaFast) {
double slPrice = Ask + stopLoss;
double tpPrice = Ask - takeProfit;
trade.Sell(lotSize, Symbol(), slPrice, tpPrice, 0, "Sell Order");
}
}