Disliked{quote} Before you mingled with the EA, you should have better added arrows to the indicator based on the proposed if() in the EA. That would be enough to show the nonsensity.Ignored
1
I will code your pivot EAs for no charge 28 replies
I will code your scalping EAs for no charge 163 replies
Oanda MT4 - Indicators and EAs not showing 2 replies
EAs and indicators relating to moutaki... 22 replies
InterbankFX has loaded its MT4 platform with custom EAs, indicators and scripts 1 reply
Disliked{quote} Before you mingled with the EA, you should have better added arrows to the indicator based on the proposed if() in the EA. That would be enough to show the nonsensity.Ignored
DislikedHi BestTraderEv, When you have time would you add the following labels to the attached MT5 Indicator. I have tried to find the indicator with the lisedt labels, but it seems none is available in the MT5 format. Thank you for your help. (+2/8) Extreme Overshoot (+1/8) Overshoot (8/8) Ultimate Resistance (7/8) Weak Stall & Reverse (6/8) Reversal Major (5/8) Top-Trading Range (4/8) Major Support & Resistance (3/8) Bottom-Trading Range (2/8) Reversal-Major (1/8) Weak Stall & Reverse (0/8) Ultimate Support (-1/8) Overshoot (-2/8) Extreme Overshoot These...Ignored
Disliked{quote} The sum would be the "travel". There was a study on price travel done years ago.#advancedalientrading youtu.be/Z9ESm6ED_-g?si=z8nxZsPFMrzw2nec
Ignored
Disliked{quote} You, really need to use Google... https://www.earnforex.com/metatrader...y-Math-Line-X/Ignored
DislikedHi BestTraderEv, When you have time would you add the following labels to the attached MT5 Indicator. I have tried to find the indicator with the lisedt labels, but it seems none is available in the MT5 format. Thank you for your help. (+2/8) Extreme Overshoot (+1/8) Overshoot (8/8) Ultimate Resistance (7/8) Weak Stall & Reverse (6/8) Reversal Major (5/8) Top-Trading Range (4/8) Major Support & Resistance (3/8) Bottom-Trading Range (2/8) Reversal-Major (1/8) Weak Stall & Reverse (0/8) Ultimate Support (-1/8) Overshoot (-2/8) Extreme Overshoot These...Ignored
DislikedOnly few bugs to correct as I am not expert in the coding. Have the strategy advance trading and been trading. Now I want to develop EA and later add in AI function. {file}Ignored
/*--------------------------------------------------------------------
Change-log: Fractal EA MT5
Date: 06-01-2025
By: MwlRCT
- Fixed unbalanced parentheses issue in line 191
- Implemented ResetDailyTradeLimits function declaration
- Fixed syntax errors in function calls (missing expressions)
- Implemented IsWithinTradeWindow function
- Implemented CheckDrawdownLimit function
- Updated trading functions:
* Replaced deprecated OP_BUY/OP_SELL constants with modern equivalents
* Updated Ask/Bid price retrieval method
* Fixed OrderSend parameters to match MqlTradeRequest/MqlTradeResult structure
- Implemented DrawSupportResistance function
- Implemented DrawFractalTrendLines function
- Fixed parenthesis syntax in line 149
- Total fixes: 18 compiler errors resolved
--------------------------------------------------------------------*/ //+------------------------------------------------------------------+
//| FractalEA.mq5|
//| Generated by ChatGPT |
//+------------------------------------------------------------------+
#property strict
// Input parameters for fractal detection and risk management
input int FractalBars = 2; // Adjustable number of bars/candles for fractal
input int MaxTradesPerDay = 5; // Maximum trades allowed per day
input double MaxLotPerDay = 1.0; // Maximum lot size allowed per day
input int TradeStartHour = 9; // Start hour (in server time) for trade execution
input int TradeEndHour = 17; // End hour (in server time) for trade execution
input double MaxDrawdownPercent = 5; // Max allowable drawdown percentage for the day
input double LotSize = 0.1; // Lot size for trades
input int Slippage = 10; // Maximum slippage allowed for trade execution
input int MagicNumber = 123456; // Magic number to identify trades by this EA
// Input parameters for visualization
input color SupportLineColor = Lime; // Support line color
input color ResistanceLineColor = Red; // Resistance line color
input color UptrendLineColor = Green; // Uptrend line color
input color DowntrendLineColor = Orange;// Downtrend line color
input int LineWidth = 2; // Line width for trend lines
// Global variables to track trades and risk
int TradesOpenedToday = 0; // Track the number of trades opened today
double TotalLotsToday = 0.0; // Track the total lots opened today
double DailyHighBalance; // Track the highest account balance during the day
double FractalUp, FractalDown; // Store fractal levels (high/low)
int FractalUpBar, FractalDownBar; // Store the fractal bar numbers
int LastFractalUpBar = 0, LastFractalDownBar = 0; // Track the last fractal bar numbers
//+------------------------------------------------------------------+
//| Expert initialization function |
//+------------------------------------------------------------------+
int OnInit()
{
// Initialize variables
DailyHighBalance = AccountInfoDouble(ACCOUNT_BALANCE);
// Display EA status message on the chart
Comment("EA is active. Monitoring for signals.");
// Return success
return(INIT_SUCCEEDED);
}
//+------------------------------------------------------------------+
//| Expert tick function |
//+------------------------------------------------------------------+
void OnTick()
{
// Reset trade counters at the start of a new day
ResetDailyTradeLimits();
// Check if within trading time window and if max drawdown is not exceeded
if(!IsWithinTradeWindow() || CheckDrawdownLimit())
{
Comment("Trading paused. Outside trading hours or drawdown limit reached.");
return;
}
// Redraw fractals and trendlines on the chart
RedrawFractals();
// Example: If fractal conditions are met, open a trade
// Check fractal breakouts for buy or sell signals
CheckFractalBreakout();
}
//+------------------------------------------------------------------+
//| Function to reset daily trade limits |
//+------------------------------------------------------------------+
void ResetDailyTradeLimits()
{
static datetime lastResetTime = 0;
datetime currentTime = TimeCurrent();
MqlDateTime currentTimeStruct;
TimeToStruct(currentTime, currentTimeStruct);
MqlDateTime lastResetTimeStruct;
TimeToStruct(lastResetTime, lastResetTimeStruct);
if (currentTimeStruct.day_of_year != lastResetTimeStruct.day_of_year)
{
TradesOpenedToday = 0;
TotalLotsToday = 0.0;
lastResetTime = currentTime;
}
}
//+------------------------------------------------------------------+
//| Function to check if within trading time window |
//+------------------------------------------------------------------+
bool IsWithinTradeWindow()
{
datetime currentTime = TimeCurrent();
MqlDateTime currentTimeStruct;
TimeToStruct(currentTime, currentTimeStruct);
return (currentTimeStruct.hour >= TradeStartHour && currentTimeStruct.hour < TradeEndHour);
}
//+------------------------------------------------------------------+
//| Function to check if max drawdown is exceeded |
//+------------------------------------------------------------------+
bool CheckDrawdownLimit()
{
double currentBalance = AccountInfoDouble(ACCOUNT_BALANCE);
double drawdownPercent = (DailyHighBalance - currentBalance) / DailyHighBalance * 100;
return (drawdownPercent > MaxDrawdownPercent);
}
//+------------------------------------------------------------------+
//| Function to check for fractal breakouts and open trades |
//+------------------------------------------------------------------+
void CheckFractalBreakout()
{
// Check for breakout above fractal high
if(FractalUp != 0 && iClose(NULL, 0, 0) > FractalUp)
{
OpenTrade(0, LotSize); // Buy signal
Comment("Fractal Breakout: Buy order executed.");
}
// Check for breakout below fractal low
if(FractalDown != 0 && iClose(NULL, 0, 0) < FractalDown)
{
OpenTrade(1, LotSize); // Sell signal
Comment("Fractal Breakout: Sell order executed.");
}
}
//+------------------------------------------------------------------+
//| Function to open a trade |
//+------------------------------------------------------------------+
void OpenTrade(int tradeType, double lotSize)
{
// Check if daily trade and lot limits are reached
if(TradesOpenedToday >= MaxTradesPerDay || TotalLotsToday + lotSize > MaxLotPerDay)
{
Comment("Trade not executed. Daily trade or lot limit reached.");
return;
}
MqlTradeRequest request;
MqlTradeResult result;
ZeroMemory(request);
ZeroMemory(result);
request.action = TRADE_ACTION_DEAL;
request.symbol = Symbol();
request.volume = lotSize;
request.deviation = Slippage;
request.magic = MagicNumber;
if(tradeType == 0) // Buy
{
request.type = ORDER_TYPE_BUY;
request.price = SymbolInfoDouble(Symbol(), SYMBOL_ASK);
}
else // Sell
{
request.type = ORDER_TYPE_SELL;
request.price = SymbolInfoDouble(Symbol(), SYMBOL_BID);
}
if(!OrderSend(request, result))
{
Print("Error opening trade. Error code: ", GetLastError());
}
else
{
TradesOpenedToday++;
TotalLotsToday += lotSize;
Comment("Trade opened. Total trades today: ", TradesOpenedToday, ", Total lots: ", TotalLotsToday);
}
}
//+------------------------------------------------------------------+
//| Function to redraw fractals and trend lines on the chart |
//+------------------------------------------------------------------+
void RedrawFractals()
{
// Clear previous fractal objects
ObjectsDeleteAll(0, 0);
// Find most recent fractals (William's method)
FractalUp = GetWilliamFractal(true); // True for upper fractal (resistance)
FractalDown = GetWilliamFractal(false);// False for lower fractal (support)
// Draw support and resistance lines
DrawSupportResistance();
// Draw trendlines connecting the fractals
DrawFractalTrendLines();
// Display status on chart
Comment("EA Active | Fractal Up: ", FractalUp, " | Fractal Down: ", FractalDown);
}
//+------------------------------------------------------------------+
//| Get William's fractal (upper or lower) |
//+------------------------------------------------------------------+
double GetWilliamFractal(bool isUpper)
{
for(int i = FractalBars + 2; i < Bars(_Symbol, PERIOD_CURRENT); i++)
{
// Check for upper fractal (swing high)
if(isUpper && IsFractalHigh(i))
{
FractalUpBar = i;
return iHigh(NULL, 0, i);
}
if(!isUpper && IsFractalLow(i))
{
FractalDownBar = i;
return iLow(NULL, 0, i);
}
}
return 0; // No fractal found
}
//+------------------------------------------------------------------+
//| Check if a bar is a fractal high (William's method) |
//+------------------------------------------------------------------+
bool IsFractalHigh(int barIndex)
{
return (iHigh(NULL, 0, barIndex) > iHigh(NULL, 0, barIndex + 1) &&
iHigh(NULL, 0, barIndex) > iHigh(NULL, 0, barIndex + 2) &&
iHigh(NULL, 0, barIndex) > iHigh(NULL, 0, barIndex - 1) &&
iHigh(NULL, 0, barIndex) > iHigh(NULL, 0, barIndex - 2));
}
//+------------------------------------------------------------------+
//| Check if a bar is a fractal low (William's method) |
//+------------------------------------------------------------------+
bool IsFractalLow(int barIndex)
{
return (iLow(NULL, 0, barIndex) < iLow(NULL, 0, barIndex + 1) &&
iLow(NULL, 0, barIndex) < iLow(NULL, 0, barIndex + 2) &&
iLow(NULL, 0, barIndex) < iLow(NULL, 0, barIndex - 1) &&
iLow(NULL, 0, barIndex) < iLow(NULL, 0, barIndex - 2));
}
//+------------------------------------------------------------------+
//| Draw support and resistance lines based on recent fractals |
//+------------------------------------------------------------------+
void DrawSupportResistance()
{
if(FractalUp != 0)
{
// Draw resistance line
string resistanceLine = "FractalResistance";
ObjectCreate(0, resistanceLine, OBJ_HLINE, 0, 0, FractalUp);
ObjectSetInteger(0, resistanceLine, OBJPROP_COLOR, ResistanceLineColor);
ObjectSetInteger(0, resistanceLine, OBJPROP_WIDTH, LineWidth);
}
if(FractalDown != 0)
{
// Draw support line
string supportLine = "FractalSupport";
ObjectCreate(0, supportLine, OBJ_HLINE, 0, 0, FractalDown);
ObjectSetInteger(0, supportLine, OBJPROP_COLOR, SupportLineColor);
ObjectSetInteger(0, supportLine, OBJPROP_WIDTH, LineWidth);
}
}
//+------------------------------------------------------------------+
//| Draw trendlines connecting the fractals |
//+------------------------------------------------------------------+
void DrawFractalTrendLines()
{
if(FractalUp != 0 && FractalDown != 0)
{
// Draw uptrend line
string uptrendLine = "FractalUptrend";
ObjectCreate(0, uptrendLine, OBJ_TREND, 0, iTime(NULL, 0, FractalDownBar), FractalDown, iTime(NULL, 0, FractalUpBar), FractalUp);
ObjectSetInteger(0, uptrendLine, OBJPROP_COLOR, UptrendLineColor);
ObjectSetInteger(0, uptrendLine, OBJPROP_WIDTH, LineWidth);
// Draw downtrend line
string downtrendLine = "FractalDowntrend";
ObjectCreate(0, downtrendLine, OBJ_TREND, 0, iTime(NULL, 0, FractalUpBar), FractalUp, iTime(NULL, 0, FractalDownBar), FractalDown);
ObjectSetInteger(0, downtrendLine, OBJPROP_COLOR, DowntrendLineColor);
ObjectSetInteger(0, downtrendLine, OBJPROP_WIDTH, LineWidth);
}
}
//+------------------------------------------------------------------+ Disliked{quote} BEFORE: {image} AFTER: {image} /*-------------------------------------------------------------------- Change-log: Fractal EA MT5 Date: 06-01-2025 By: MwlRCT - Fixed unbalanced parentheses issue in line 191 - Implemented ResetDailyTradeLimits function declaration - Fixed syntax errors in function calls (missing expressions) - Implemented IsWithinTradeWindow function - Implemented CheckDrawdownLimit function - Updated trading functions: * Replaced deprecated OP_BUY/OP_SELL constants with modern equivalents * Updated Ask/Bid price retrieval...Ignored
Disliked{quote} yes if you understand the basic coding the chatgpt can be of a great help - but sometimes it can fool you so nicely - my experienceIgnored
DislikedGood day,l need your help in coding an mt4 indicator using tick volume,basically an indicator that can add all incoming ticks on all 28pairs.The indicator must then print it in bars.it needs to look at total tick volume level coming into platform .cut it short....l need an indi or meter to monitor overall tick volume.Kindly helpIgnored
Disliked{quote} Can you upload a screenshot of how it looks like on the charts??Ignored