Spezifikation
//+------------------------------------------------------------------+
//| ICT_SMC_CRT_EA.mq5 |
//| Automated SMC / ICT / CRT Execution Engine |
//+------------------------------------------------------------------+
#property copyright "Automated SMC Engine"
#property version "1.00"
#property strict
#include <Trade\Trade.mqh>
//--- Trade Object
CTrade trade;
//--- Inputs
input group "=== Risk & Money Management ==="
input double InpRiskPercent = 1.0; // Risk % per trade (e.g., 1.0 = 1%)
input double InpRiskReward = 3.0; // Target Risk : Reward Ratio (1:3)
input double InpSLBufferPips = 2.0; // SL Buffer past sweep extreme (in Pips)
input ulong InpMagicNumber = 888111; // Unique Magic Number for this EA
input group "=== Confluence Strategy Filters ==="
input bool InpUseSMC = true; // Enable SMC Imbalance (FVG) Filter
input bool InpUseCRT = true; // Enable CRT Range Expansion
input int InpPivotStrength = 5; // Pivot Strength (Bars Left & Right)
input double InpMinFvgPips = 1.5; // Min Fair Value Gap Size (in Pips)
input group "=== Session & Trend Filters ==="
input bool InpFilterTrend = true; // Filter Entries with 200 EMA
input int InpEmaPeriod = 200; // Dynamic Trend EMA Period
input bool InpFilterSessions = true; // Active Session Filter (London/NY)
input int InpLondonStartHour = 7; // Session Start UTC (7 AM London)
input int InpNYEndHour = 17; // Session End UTC (5 PM NY)
//--- Global Variables
int emaHandle = INVALID_HANDLE;
datetime lastTradeTime = 0;
//+------------------------------------------------------------------+
//| Expert initialization function |
//+------------------------------------------------------------------+
int OnInit()
{
trade.SetExpertMagicNumber(InpMagicNumber);
if(InpFilterTrend)
{
emaHandle = iMA(_Symbol, _Period, InpEmaPeriod, 0, MODE_EMA, PRICE_CLOSE);
if(emaHandle == INVALID_HANDLE)
{
Print("Error initializing EMA handle for EA.");
return(INIT_FAILED);
}
}
Print("ICT/SMC/CRT Expert Advisor initialized successfully.");
return(INIT_SUCCEEDED);
}
//+------------------------------------------------------------------+
//| Expert deinitialization function |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
{
if(emaHandle != INVALID_HANDLE) IndicatorRelease(emaHandle);
}
//+------------------------------------------------------------------+
//| Expert tick function |
//+------------------------------------------------------------------+
void OnTick()
{
// Process only on new bar close to prevent over-trading
static datetime lastBarTime = 0;
datetime currentBarTime = iTime(_Symbol, _Period, 0);
if(currentBarTime == lastBarTime) return;
lastBarTime = currentBarTime;
// Check if we already have an open position with our Magic Number
if(HasOpenPosition()) return;
// Ensure price bar arrays are ready
MqlRates rates[];
ArraySetAsSeries(rates, true);
int copied = CopyRates(_Symbol, _Period, 0, InpPivotStrength * 2 + InpEmaPeriod + 10, rates);
if(copied < InpPivotStrength * 2 + InpEmaPeriod + 10) return;
// Index 1 represents the most recently CLOSED candle
int i = 1;
// 1. Session Filter Check
if(InpFilterSessions && !IsInActiveSession(rates[i].time)) return;
// Get EMA Data
double emaVal = 0.0;
if(InpFilterTrend)
{
double emaArray[];
ArraySetAsSeries(emaArray, true);
if(CopyBuffer(emaHandle, 0, 0, 5, emaArray) <= 0) return;
emaVal = emaArray[i];
}
double pipFactor = (_Digits == 3 || _Digits == 5) ? 10.0 * _Point : _Point;
// 2. Identify Structural Swing Levels
double swingLow = FindRecentSwingLow(rates, i + 1, InpPivotStrength, copied);
double swingHigh = FindRecentSwingHigh(rates, i + 1, InpPivotStrength, copied);
// --- BULLISH BUY SETUP ---
if(swingLow > 0.0 && rates[i].low < swingLow && rates[i].close > swingLow)
{
bool trendValid = !InpFilterTrend || (rates[i].close > emaVal);
bool fvgValid = !InpUseSMC || IsBullishFVG(rates, i, pipFactor);
bool crtValid = !InpUseCRT || IsCRTSweepBullish(rates, i);
if(trendValid && fvgValid && crtValid)
{
double entry = SymbolInfoDouble(_Symbol, SYMBOL_ASK);
double sl = rates[i].low - (InpSLBufferPips * pipFactor);
double risk = entry - sl;
double tp = entry + (risk * InpRiskReward);
double lotSize = CalculateLotSize(risk);
if(lotSize > 0)
{
trade.Buy(lotSize, _Symbol, entry, sl, tp, "SMC Bullish Sweep EA");
}
}
}
// --- BEARISH SELL SETUP ---
if(swingHigh > 0.0 && rates[i].high > swingHigh && rates[i].close < swingHigh)
{
bool trendValid = !InpFilterTrend || (rates[i].close < emaVal);
bool fvgValid = !InpUseSMC || IsBearishFVG(rates, i, pipFactor);
bool crtValid = !InpUseCRT || IsCRTSweepBearish(rates, i);
if(trendValid && fvgValid && crtValid)
{
double entry = SymbolInfoDouble(_Symbol, SYMBOL_BID);
double sl = rates[i].high + (InpSLBufferPips * pipFactor);
double risk = sl - entry;
double tp = entry - (risk * InpRiskReward);
double lotSize = CalculateLotSize(risk);
if(lotSize > 0)
{
trade.Sell(lotSize, _Symbol, entry, sl, tp, "SMC Bearish Sweep EA");
}
}
}
}
//+------------------------------------------------------------------+
//| Dynamic Lot Size Calculation Based on % Risk |
//+------------------------------------------------------------------+
double CalculateLotSize(double riskInPoints)
{
if(riskInPoints <= 0) return 0.0;
double balance = AccountInfoDouble(ACCOUNT_BALANCE);
double riskAmount = balance * (InpRiskPercent / 100.0);
double tickValue = SymbolInfoDouble(_Symbol, SYMBOL_TRADE_TICK_VALUE);
double tickSize = SymbolInfoDouble(_Symbol, SYMBOL_TRADE_TICK_SIZE);
if(tickSize <= 0 || tickValue <= 0) return 0.0;
double lotStep = SymbolInfoDouble(_Symbol, SYMBOL_VOLUME_STEP);
double minLot = SymbolInfoDouble(_Symbol, SYMBOL_VOLUME_MIN);
double maxLot = SymbolInfoDouble(_Symbol, SYMBOL_VOLUME_MAX);
double rawLot = riskAmount / ((riskInPoints / tickSize) * tickValue);
double customLot = MathFloor(rawLot / lotStep) * lotStep;
return MathMax(minLot, MathMin(maxLot, customLot));
}
//+------------------------------------------------------------------+
//| Check if open positions exist for this Magic Number |
//+------------------------------------------------------------------+
bool HasOpenPosition()
{
for(int k = PositionsTotal() - 1; k >= 0; k--)
{
if(PositionGetSymbol(k) == _Symbol)
{
if(PositionGetInteger(POSITION_MAGIC) == InpMagicNumber)
return true;
}
}
return false;
}
//+------------------------------------------------------------------+
//| Helper Confluence Checks |
//+------------------------------------------------------------------+
bool IsInActiveSession(datetime barTime)
{
MqlDateTime dt;
TimeToStruct(barTime, dt);
return (dt.hour >= InpLondonStartHour && dt.hour <= InpNYEndHour);
}
bool IsBullishFVG(const MqlRates &rates[], int i, double pipFactor)
{
return ((rates[i].low - rates[i + 2].high) >= (InpMinFvgPips * pipFactor));
}
bool IsBearishFVG(const MqlRates &rates[], int i, double pipFactor)
{
return ((rates[i + 2].low - rates[i].high) >= (InpMinFvgPips * pipFactor));
}
bool IsCRTSweepBullish(const MqlRates &rates[], int i)
{
return (rates[i].low < rates[i + 1].low && rates[i].close > rates[i + 1].low);
}
bool IsCRTSweepBearish(const MqlRates &rates[], int i)
{
return (rates[i].high > rates[i + 1].high && rates[i].close < rates[i + 1].high);
}
double FindRecentSwingLow(const MqlRates &rates[], int startIdx, int strength, int totalBars)
{
for(int k = startIdx; k <= totalBars - strength - 1; k++)
{
bool isPivot = true;
for(int j = 1; j <= strength; j++)
{
if(rates[k].low >= rates[k - j].low || rates[k].low >= rates[k + j].low)
{
isPivot = false;
break;
}
}
if(isPivot) return rates[k].low;
}
return 0.0;
}
double FindRecentSwingHigh(const MqlRates &rates[], int startIdx, int strength, int totalBars)
{
for(int k = startIdx; k <= totalBars - strength - 1; k++)
{
bool isPivot = true;
for(int j = 1; j <= strength; j++)
{
if(rates[k].high <= rates[k - j].high || rates[k].high <= rates[k + j].high)
{
isPivot = false;
break;
}
}
if(isPivot) return rates[k].high;
}
return 0.0;
}
//+------------------------------------------------------------------+
Bewerbungen
1
Bewertung
Projekte
21
19%
Schlichtung
5
40%
/
40%
Frist nicht eingehalten
0
Frei
2
Bewertung
Projekte
28
39%
Schlichtung
8
25%
/
38%
Frist nicht eingehalten
2
7%
Beschäftigt
Veröffentlicht: 8 Artikel, 35 Beispiele
3
Bewertung
Projekte
1
0%
Schlichtung
1
0%
/
100%
Frist nicht eingehalten
0
Frei
4
Bewertung
Projekte
0
0%
Schlichtung
0
Frist nicht eingehalten
0
Frei
5
Bewertung
Projekte
1
0%
Schlichtung
0
Frist nicht eingehalten
1
100%
Frei
6
Bewertung
Projekte
29
3%
Schlichtung
4
0%
/
100%
Frist nicht eingehalten
5
17%
Frei
7
Bewertung
Projekte
3
67%
Schlichtung
0
Frist nicht eingehalten
0
Arbeitet
Veröffentlicht: 2 Beispiele
8
Bewertung
Projekte
112
56%
Schlichtung
2
50%
/
0%
Frist nicht eingehalten
3
3%
Frei
Veröffentlicht: 1 Beispiel
9
Bewertung
Projekte
0
0%
Schlichtung
0
Frist nicht eingehalten
0
Frei
10
Bewertung
Projekte
0
0%
Schlichtung
0
Frist nicht eingehalten
0
Frei
11
Bewertung
Projekte
0
0%
Schlichtung
0
Frist nicht eingehalten
0
Frei
12
Bewertung
Projekte
0
0%
Schlichtung
0
Frist nicht eingehalten
0
Frei
13
Bewertung
Projekte
455
55%
Schlichtung
24
54%
/
17%
Frist nicht eingehalten
31
7%
Beschäftigt
Ähnliche Aufträge
Purpose Develop a transparent and conservative Expert Advisor for MetaTrader 5. Profit is not guaranteed; acceptance is based on correct implementation, risk controls and reproducible testing. 1. Platform and instruments - Native MQL5 Expert Advisor for MetaTrader 5. - Symbols: EURUSD and USDJPY. - Working timeframe: H1. Higher-timeframe trend filter: H4. - Must support standard broker symbol suffixes/prefixes and
Please may someone assist me with the indicator attached, it has a SERIOUS BUG issue in the sense that when I load it, and activate the template (attached as well) MT4 ALWAYS freezes and then eventually disconnects automatically, ALL THE TIME. It even gets worse to an extent that after disconnecting a number of times mt4 ends up not loading anymore, UNTIL I remove the indicator. Please I WILL NEED A DEMO (FOR A DAY)
NinjaTrader 8 Strategy Development
100+ USD
I’m looking for an experienced NinjaTrader 8 developer to build an automated strategy using the Imbalance Profile Lidar indicator by ninZa.co on MNQ DEC26 with a 3000-volume chart . Requirements: Enter Long when a blue absorption dot appears below price with an absorption value. Enter Short when a pink absorption dot appears above price with an absorption value. Stop loss: 15 ticks behind the signal dot price . Take
Ola, Tenho um Bot mas parou de funcionar, preciso de programador que desenvolva o mesmo configurações. Envio o antigo bot para pegar as configurações e realizar outro modelo. Hello, I have a bot that has stopped working, and I need a programmer to develop one with the same settings. I can send the old bot so you can extract the settings and build a new version
Convert mt5 EA to cTrader bot
30+ USD
I have a simple EA that trades based on pending orders I need it to be converted to cTrader am looking for expert developer that have experience in ctrader that can convert metatrader 5 robot to ctrader
SPECIAL BAR EA
30+ USD
Hello Dear Coders , Here is a strategy with calculations on a specific bar ,sould be implemented carefully. Calculation on the bar needs math at some degree . trade numbers and trade results should be written right below the specific bar . Vague points should be cleared before starting coding. below is the %80 of full strategy and its explanations , the full will be given after selecting developer. POSITIONS ON A
Hello, I'm looking to develop a Forex Expert Advisor (EA) for MetaTrader 5 (MT5). I have an existing strategy and I'm looking for a complete solution developed from scratch. The main requirements are: Strategy research and development profitable trading objectives. Automated Forex trading with clearly defined entry and exit rules. Risk management, including stop-loss, take-profit, and position sizing. Backtesting and
Hello Developers, I am looking for an experienced MQL5 developer to build a custom Expert Advisor (EA) for MetaTrader 5 (MT5) based on ICT (Inner Circle Trader) concepts and Support/Resistance price action. Key Features & Strategy Requirements: 1. Market Structure & Price Action: - Identify Support and Resistance zones automatically. - Detect Break of Structure (BOS) and Change of Character (CHoCH). - Identify
A video of the front end project is attached or uploaded in the link for view, the project is to build web app trader for login of mt4 / mt5 login and trades, the Web app is still under development your ideas matter in this project feel free to share ideal regards this project if you are good in Visual studio 2022 VS code and have handled C++ projects before on multiple situation this project might be yours. UI/UX
I am looking for an experienced MQL5 developer to build a fully automated MT5 Expert Advisor for XAUUSD. The trading rules are already defined. I need the developer to implement them accurately in MQL5, not redesign the strategy. Main requirements: XAUUSD Multi-timeframe logic: H1 direction, M15 setup, M5 entry Entry only after candle-close confirmation No repainting / closed-bar logic Configurable Stop Loss and Take
Projektdetails
Budget
100+ USD
Kunde
Veröffentlichte Aufträge1
Anzahl der Schlichtungen0