Specification
#property copyright "Copyright 2024, Trade Smart Fx Tools"
#property link "tradesmartfxtools.online"
#property version "1.00"
#property strict
// Global Varibles
int MAGIC_NUMBER = 0907200406;
string labelName = "tradesmartfxtools.online";
string updatedLabelName = "updated_version_label";
string updatedLabelText = "Updated version available at tradesmartfxtools.online";
string labelText = "EA by tradesmartfxtools.online";
string buyProfitLabelName = "OverallBuyProfitLabel";
string sellProfitLabelName = "OverallSellProfitLabel";
int labelFontSize = 16;
int updatedLabelFontSize = 12;
color labelColor = Yellow;
color profitLabelColor = White;
color lossLabelColor = White;
int spaceFromBottom = 50;
color updatedLabelColor = White;
int updatedSpaceFromBottom = 20;
input int fastMAPeriod = 10; // Period for fast MA
input int slowMAPeriod = 25; // Period for slow MA
//+------------------------------------------------------------------+
//| Labels |
//+------------------------------------------------------------------+
void createOrUpdateLabels(double buyProfit, double sellProfit)
{
if(ObjectFind(0, labelName) == -1)
{
ObjectCreate(0, labelName, OBJ_LABEL, 0, 0, 0);
}
ObjectSetInteger(0, labelName, OBJPROP_CORNER, CORNER_LEFT_LOWER);
ObjectSetInteger(0, labelName, OBJPROP_XDISTANCE, 10);
ObjectSetInteger(0, labelName, OBJPROP_YDISTANCE, spaceFromBottom);
ObjectSetInteger(0, labelName, OBJPROP_COLOR, labelColor);
ObjectSetInteger(0, labelName, OBJPROP_FONTSIZE, labelFontSize);
ObjectSetInteger(0, labelName, OBJPROP_SELECTABLE, false);
ObjectSetInteger(0, labelName, OBJPROP_SELECTED, false);
ObjectSetString(0, labelName, OBJPROP_TEXT, labelText);
if(ObjectFind(0, updatedLabelName) == -1)
{
ObjectCreate(0, updatedLabelName, OBJ_LABEL, 0, 0, 0);
}
ObjectSetInteger(0, updatedLabelName, OBJPROP_CORNER, CORNER_LEFT_LOWER);
ObjectSetInteger(0, updatedLabelName, OBJPROP_XDISTANCE, 10);
ObjectSetInteger(0, updatedLabelName, OBJPROP_YDISTANCE, updatedSpaceFromBottom);
ObjectSetInteger(0, updatedLabelName, OBJPROP_COLOR, updatedLabelColor);
ObjectSetInteger(0, updatedLabelName, OBJPROP_FONTSIZE, updatedLabelFontSize);
ObjectSetString(0, updatedLabelName, OBJPROP_TEXT, updatedLabelText);
// Create or update the buy profit label
string buyProfitText = "Overall Buy Profit: " + DoubleToString(buyProfit, 2);
if(ObjectFind(0, buyProfitLabelName) == -1)
{
ObjectCreate(0, buyProfitLabelName, OBJ_LABEL, 0, 0, 0);
}
ObjectSetInteger(0, buyProfitLabelName, OBJPROP_CORNER, CORNER_LEFT_UPPER);
ObjectSetInteger(0, buyProfitLabelName, OBJPROP_XDISTANCE, 20);
ObjectSetInteger(0, buyProfitLabelName, OBJPROP_YDISTANCE, spaceFromBottom - 6); // Adjusted Y position
ObjectSetInteger(0, buyProfitLabelName, OBJPROP_COLOR, profitLabelColor);
ObjectSetInteger(0, buyProfitLabelName, OBJPROP_FONTSIZE, labelFontSize);
ObjectSetInteger(0, buyProfitLabelName, OBJPROP_SELECTABLE, false);
ObjectSetInteger(0, buyProfitLabelName, OBJPROP_SELECTED, false);
ObjectSetString(0, buyProfitLabelName, OBJPROP_TEXT, buyProfitText);
// Create or update the sell profit label
string sellProfitText = "Overall Sell Profit: " + DoubleToString(sellProfit, 2);
if(ObjectFind(0, sellProfitLabelName) == -1)
{
ObjectCreate(0, sellProfitLabelName, OBJ_LABEL, 0, 0, 0);
}
ObjectSetInteger(0, sellProfitLabelName, OBJPROP_CORNER, CORNER_LEFT_UPPER);
ObjectSetInteger(0, sellProfitLabelName, OBJPROP_XDISTANCE, 20);
ObjectSetInteger(0, sellProfitLabelName, OBJPROP_YDISTANCE, spaceFromBottom - 36); // Adjusted Y position
ObjectSetInteger(0, sellProfitLabelName, OBJPROP_COLOR, lossLabelColor);
ObjectSetInteger(0, sellProfitLabelName, OBJPROP_FONTSIZE, labelFontSize);
ObjectSetInteger(0, sellProfitLabelName, OBJPROP_SELECTABLE, false);
ObjectSetInteger(0, sellProfitLabelName, OBJPROP_SELECTED, false);
ObjectSetString(0, sellProfitLabelName, OBJPROP_TEXT, sellProfitText);
}
//+------------------------------------------------------------------+
//| Expert initialization function |
//+------------------------------------------------------------------+
int OnInit()
{
createOrUpdateLabels(0.0, 0.0); // Initialize labels with 0 profit and trade counts
return(INIT_SUCCEEDED);
}
//+------------------------------------------------------------------+
//| Expert deinitialization function |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
{
// Delete the main EA label
if(ObjectFind(0, labelName) != -1)
ObjectDelete(0, labelName);
// Delete the updated version label
if(ObjectFind(0, updatedLabelName) != -1)
ObjectDelete(0, updatedLabelName);
// Delete the buy profit label
if(ObjectFind(0, buyProfitLabelName) != -1)
ObjectDelete(0, buyProfitLabelName);
// Delete the sell profit label
if(ObjectFind(0, sellProfitLabelName) != -1)
ObjectDelete(0, sellProfitLabelName);
Print("All labels have been removed.");
}
//+------------------------------------------------------------------+
//| Expert tick function |
//+------------------------------------------------------------------+
void OnTick()
{
double totalBuyProfit = 0.0;
double totalSellProfit = 0.0;
// Calculate total buy and sell profits and count trades
for(int i = OrdersTotal() - 1; i >= 0; i--)
{
if(OrderSelect(i, SELECT_BY_POS, MODE_TRADES) && OrderSymbol() == _Symbol)
{
if(OrderType() == OP_BUY)
{
totalBuyProfit += OrderProfit();
}
else
if(OrderType() == OP_SELL)
{
totalSellProfit += OrderProfit();
}
}
}
createOrUpdateLabels(totalBuyProfit, totalSellProfit);
CloseProfitableTradesOnMACrossover();
}
//+------------------------------------------------------------------+
//| Close Profitable Trades On MA Crossover |
//+------------------------------------------------------------------+
void CloseProfitableTradesOnMACrossover()
{
double fastMA = iMA(NULL, 0, fastMAPeriod, 0, MODE_SMA, PRICE_CLOSE, 0);
double slowMA = iMA(NULL, 0, slowMAPeriod, 0, MODE_SMA, PRICE_CLOSE, 0);
double fastMA_prev = iMA(NULL, 0, fastMAPeriod, 0, MODE_SMA, PRICE_CLOSE, 1);
double slowMA_prev = iMA(NULL, 0, slowMAPeriod, 0, MODE_SMA, PRICE_CLOSE, 1);
// Check for crossover
bool bullishCrossover = fastMA_prev < slowMA_prev && fastMA > slowMA;
bool bearishCrossover = fastMA_prev > slowMA_prev && fastMA < slowMA;
if(bullishCrossover || bearishCrossover)
{
// Loop through all open trades
int totalOrders = OrdersTotal();
if(totalOrders == 0)
{
Print("No open orders found.");
return;
}
for(int i = totalOrders - 1; i >= 0; i--)
{
if(OrderSelect(i, SELECT_BY_POS, MODE_TRADES))
{
// Check if the trade is profitable
double profit = OrderProfit();
if(profit >= 0)
{
// Attempt to close the order
bool closed = false;
if(OrderType() == OP_BUY)
{
closed = OrderClose(OrderTicket(), OrderLots(), Bid, 2, clrRed);
if(closed)
Print("Closed profitable Buy order ", OrderTicket(), " with profit: ", profit);
else
Print("Error closing Buy order ", OrderTicket(), ": Error code ", GetLastError());
}
else
if(OrderType() == OP_SELL)
{
closed = OrderClose(OrderTicket(), OrderLots(), Ask, 2, clrRed);
if(closed)
Print("Closed profitable Sell order ", OrderTicket(), " with profit: ", profit);
else
Print("Error closing Sell order ", OrderTicket(), ": Error code ", GetLastError());
}
}
else
{
Print("Order ", OrderTicket(), " is not profitable, skipping.");
}
}
else
{
Print("Error selecting order ", i, ": Error code ", GetLastError());
}
}
}
}
//+------------------------------------------------------------------+
Responded
1
Rating
Projects
311
28%
Arbitration
33
27%
/
64%
Overdue
10
3%
Free
2
Rating
Projects
191
58%
Arbitration
10
80%
/
0%
Overdue
0
Free
Published: 1 code
3
Rating
Projects
570
37%
Arbitration
106
39%
/
33%
Overdue
17
3%
Free
4
Rating
Projects
2
0%
Arbitration
1
0%
/
0%
Overdue
0
Free
5
Rating
Projects
399
27%
Arbitration
39
41%
/
49%
Overdue
1
0%
Free
6
Rating
Projects
628
33%
Arbitration
38
37%
/
50%
Overdue
11
2%
Loaded
7
Rating
Projects
256
30%
Arbitration
0
Overdue
3
1%
Free
Published: 2 codes
8
Rating
Projects
472
40%
Arbitration
102
40%
/
24%
Overdue
78
17%
Busy
Published: 2 codes
Similar orders
EA based on supply and demand zones indicator
30 - 100 USD
im looking for an EA to be created based off of the SMC indicator below https://www.mql5.com/en/market/product/152417?source=Site +Market+MT5+Indicator+Search+Rating006%3asmc+market+ with lot size adjustment in settings, take profit and stop loss, mobile push notifications and start end time with max sell and buy order setting. i would like to add the SMC indicator to the EA and enter/close on the red and green
I’m looking for developer to build an AI-assisted trading system for Metatader 5 . You to deliver, working MT5 module, AI module (Python or compatible), source codes for both This phase is focused strictly on core logic and AI integration , not UI or dashboards. Kindly reach out only if you have experience on AI integration and prove of past work
Description: I am looking for a professional MQL4 developer/quant trader with a proven track record in EA optimization. This project involves optimizing a third-party EA that currently has a 2-year live track record. The Task: In-Sample Optimization: Optimize the EA parameters using historical data prior to January 1, 2024. Out-of-Sample (Walk-Forward): Validate the optimized settings against the period of
Trade settings: --------------------------------- fixed lot size ….. 0.0 Buy /Sell distance market order…. 0.0 - 700.0 points Buy / Sell distance pending order Entry---- 0.0 - 700.0 points Max Trade------ 10.0 Min spread...… 0.0 points Max spread..... 3000.0 points Daily profit percentage ….. 0.0 - 100 % Global Stoploss Percentage----- 0.0 - 100 % Max Daily loss Percentage ------0.0 - 100 % Stop level = 0.0 point
Gold (XAUUSD) M1 MSS Strategy (Funded Account)
40 - 150 USD
📌 General 🔸 Pair: XAUUSD (Gold) 🔸 Timeframe: M1 only 🔸 Strategy: Funded account ❌ No over-trading 📊 Trade Frequency Rules 🔹 One win OR one loss per day only 🔹 If trade goes Break-Even, another trades allowed same day 🔹 If trade hits TP or SL, trading must stop for that day 🔹 Only one active trade at a time 💰 Risk & Reward 🔹 Risk per trade: 1% 🔹 Risk–Reward (RR): 1:3 🔹 Break-Even rule: At 1:1 RR SL must
Tradingview chart setup
30+ USD
Hi , I have some indicators that I want set up on my TV chart and want to create one chart for some and another chart for some others. Plus I want to set up the brackets orders so I can trade from the chart. I have these set up somewhat but need it cleaned up and the way I want them. how much would something like this cost to do? I'm in California and would like you to show me so I can learn to do this when I want to
EMA 5 to EMA 7 Cross
30+ USD
i need EA EMA 5 to EMA 7 Cross over and in case of loss for martingale add 1 to 20 numbers we put next lots of martaingle manually not auto martaing add account no in hidden only which account only works add date of expiry in inside code add EA runinging time there is other option add on off swithch that if buy order loss than martaingle works only for recovery buy order, if sell order loss martingale works for only
Title: Creation of an EA by Breakout Fractal (without Martingale/Grille) Description: I am looking for a developer to create an Expert Advisor based on the highest and lowest (Fractals). Entry: Place Buy Stop and Sell Stop commands on the last formed peaks/hollows. Risk management: Strictly no Martingale or Grille system. Each trade must have a fixed stop loss. Features: Trailing Stop and Breakeven option. Platform
I already have programmed in MT5 EA, but I want to unfilter bad trades using Ai, about details I will tell and discuss with selected programmers, I have some ideas, prototypes, but I am open for your solutions too. I tested some time and it had possitive effects
Apply with a keen sense of responsibility . Copy the code . Both of my expert has sufficient materials . Its a simple winning strategy , therefore please be ahead of time . Code BLUE . Changing The Strategy According to what i think is correct
Project information
Budget
40+ USD