指定
//+------------------------------------------------------------------+
//| Gohan Scalper provision.mq5 |
//| Advanced Multi-Timeframe Forex Robot |
//+------------------------------------------------------------------+
#property copyright "Tshegofatso"
#property link "https://www.mql5.com"
#property version "1.00"
#property strict
#include <Trade/Trade.mqh>
CTrade trade;
//+------------------------------------------------------------------+
//| Input Parameters |
//+------------------------------------------------------------------+
enum ModeType { CONSERVATIVE, BALANCED, AGGRESSIVE };
input ModeType TradeMode = BALANCED;
input double RiskPercent = 1.0;
input double DefaultStopLossPips = 20.0;
input double MaxLot = 2.0;
//+------------------------------------------------------------------+
//| Session Time Checking |
//+------------------------------------------------------------------+
bool IsInTradingSession()
{
MqlDateTime t;
TimeToStruct(TimeCurrent(), t);
int timeInMinutes = t.hour * 60 + t.min;
return (timeInMinutes >= 60 && timeInMinutes <= 480) || // Asian
(timeInMinutes >= 480 && timeInMinutes <= 960) || // London
(timeInMinutes >= 780 && timeInMinutes <= 1320); // New York
}
//+------------------------------------------------------------------+
//| Trend Detection (D1) |
//+------------------------------------------------------------------+
int GetMarketTrend()
{
static int maFastHandle = iMA(_Symbol, PERIOD_D1, 20, 0, MODE_EMA, PRICE_CLOSE);
static int maSlowHandle = iMA(_Symbol, PERIOD_D1, 50, 0, MODE_EMA, PRICE_CLOSE);
double maFast[], maSlow[];
if(CopyBuffer(maFastHandle, 0, 0, 1, maFast) < 1 ||
CopyBuffer(maSlowHandle, 0, 0, 1, maSlow) < 1)
return 0;
if (maFast[0] > maSlow[0]) return 1; // Bullish
if (maFast[0] < maSlow[0]) return -1; // Bearish
return 0; // Sideways
}
//+------------------------------------------------------------------+
//| Break of Structure (M15) |
//+------------------------------------------------------------------+
bool DetectBreakOfStructure()
{
double highs[2];
if(CopyHigh(_Symbol, PERIOD_M15, 1, 2, highs) < 2)
return false;
return highs[0] > highs[1];
}
//+------------------------------------------------------------------+
//| Confirmation Candle (M5) |
//+------------------------------------------------------------------+
bool IsConfirmationCandle()
{
double open[1], close[1], high[1], low[1];
if(CopyOpen(_Symbol, PERIOD_M5, 0, 1, open) < 1 ||
CopyClose(_Symbol, PERIOD_M5, 0, 1, close) < 1 ||
CopyHigh(_Symbol, PERIOD_M5, 0, 1, high) < 1 ||
CopyLow(_Symbol, PERIOD_M5, 0, 1, low) < 1)
return false;
double body = MathAbs(close[0] - open[0]);
double range = high[0] - low[0];
return (body > range * 0.5);
}
//+------------------------------------------------------------------+
//| Lot Size Calculation |
//+------------------------------------------------------------------+
double CalculateLotSize(double stopLossPips)
{
double balance = AccountInfoDouble(ACCOUNT_BALANCE);
double riskAmount = balance * (RiskPercent / 100.0);
double pipValue = SymbolInfoDouble(_Symbol, SYMBOL_TRADE_TICK_VALUE);
double lotSize = riskAmount / (stopLossPips * pipValue);
return MathMin(MaxLot, MathMax(0.01, NormalizeDouble(lotSize, 2)));
}
//+------------------------------------------------------------------+
//| Enter Buy Trade |
//+------------------------------------------------------------------+
void EnterBuyTrade(double lot, double stopLossPips)
{
double sl = SymbolInfoDouble(_Symbol, SYMBOL_BID) - stopLossPips * _Point;
trade.Buy(lot, _Symbol, 0, sl, 0, "Buy Entry");
}
//+------------------------------------------------------------------+
//| Enter Sell Trade |
//+------------------------------------------------------------------+
void EnterSellTrade(double lot, double stopLossPips)
{
double sl = SymbolInfoDouble(_Symbol, SYMBOL_ASK) + stopLossPips * _Point;
trade.Sell(lot, _Symbol, 0, sl, 0, "Sell Entry");
}
//+------------------------------------------------------------------+
//| Expert Tick Function |
//+------------------------------------------------------------------+
void OnTick()
{
if(!IsInTradingSession()) return;
int trend = GetMarketTrend();
if(trend == 0) return;
if(!DetectBreakOfStructure()) return;
if(!IsConfirmationCandle()) return;
double lot = CalculateLotSize(DefaultStopLossPips);
if(trend > 0)
EnterBuyTrade(lot, DefaultStopLossPips);
else
EnterSellTrade(lot, DefaultStopLossPips);
}
//+------------------------------------------------------------------+
//| OnInit and Timer Hooks |
//+------------------------------------------------------------------+
int OnInit()
{
EventSetTimer(60);
return INIT_SUCCEEDED;
}
void OnDeinit(const int reason)
{
EventKillTimer();
}
void OnTimer()
{
// Reserved for advanced wave/fakeout/FVG logic
}
応答済み
1
評価
プロジェクト
4
0%
仲裁
5
0%
/
100%
期限切れ
0
暇
類似した注文
EA needed for long term trading - Please help
30 - 80 USD
Hello, I'm looking for an expert who can help me acquire a secure, easy-to-use bot with Turkish language support for automated buying and selling in Forex, commodities, and cryptocurrencies, and who can also teach me how to set it up and use it
Professional AI Automation Trading Bot for Forex & Crypto
500 - 1500 USD
Title Professional AI Automation Trading Bot for Forex & Crypto Solution Language Python (preferred) or MQL5 depending on integration requirements. Categories Expert Advisor (EA) for MetaTrader 5 Automated trading strategies AI/ML-based signal generation Risk management automation Required Skills Strong knowledge of MQL5/Python Experience with MetaTrader API integration Machine learning model deployment
Binance Ai Trading Bot $US700 budget negotiable
700 - 3000 USD
I need an Ai trading bot for Binance and BTC on MT5 that also uses order flow data. It should also make use of TSI- Temporal indicator sampling and also it should make use of fundamental analysis in the process of signal generation
SNIPER X AI
30 - 120 USD
I need help in building a Robot SNIPER X AI — FINAL BUILD Trading System Type AI Scalping + Sniper Entry Expert Advisor Platforms MetaTrader 4 MetaTrader 5 Supported Brokers � exness.com � justmarkets.com � deriv.com Universal MT4/MT5 broker support FINAL CORE FEATURES ✅ AI Scalping Engine ✅ Sniper Entries ✅ Auto Buy/Sell ✅ EMA Trend Detection ✅ RSI Momentum Filter ✅ Smart Stop Loss ✅ Dynamic Take Profit ✅ Trailing
SNIPER X AI
30 - 200 USD
I really need a developer Who can help me to create my SNIPER X AI - Elite AI Trading System Overview SNIPER X AI BOT is an AI-assisted trading system for Forex, Crypto, Stocks, Indices, and Gold. Currency: USD,RAND,KWD, POUND,EURO Core Features AI Scalping, Sniper Entries, Auto Buy/Sell, Smart Risk Management, Telegram Alerts, Mobile Monitoring, VPS Deployment. Supported Platforms MetaTrader 4, MetaTrader 5, Exness
プロジェクト情報
予算
30+ USD
締め切り
最高 10 日