Hello everyone. Is it possible to put a button on this indicator???
Attached File(s)
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
DislikedDear coders, Iam looking for an indicator that draws horizontal line starting from a particular date or from 2nd week of the month,thanking youIgnored
DislikedDear coders, Iam looking for an indicator that draws horizontal line starting from a particular date or from 2nd week of the month,thanking youIgnored
// Define parameters
input int startDay = 1; // Starting day (you can change it)
input int startMonth = 1; // Starting month
input int startYear = 2025; // Starting year
input bool fromSecondWeek = false; // If true, it starts from the 2nd week of the month
void OnTick()
{
datetime startTime;
// Calculate start time based on user input
if (fromSecondWeek)
{
// Calculate second week of the month
startTime = GetSecondWeekStartTime(startYear, startMonth);
}
else
{
// Use the provided start date (startYear, startMonth, startDay)
startTime = D'2025.01.01'; // Or you can use input parameters here
}
// To draw horizontal line
int x1 = startTime; // Starting date as x1
double y1 = Ask; // Price for drawing horizontal line
// If the line hasn't been created before
if (ObjectFind("HorizontalLine") == -1)
{
ObjectCreate("HorizontalLine", OBJ_HLINE, 0, x1, y1);
ObjectSetInteger(0, "HorizontalLine", OBJPROP_COLOR, clrRed);
}
}
// Function to calculate start time of the 2nd week of the month
datetime GetSecondWeekStartTime(int year, int month)
{
// Calculate the first day of the month
datetime firstDayOfMonth = D'2025.01.01'; // Adjust this dynamically based on year and month
int dayOfWeek = DayOfWeek(firstDayOfMonth); // Get day of the week for the 1st day of the month
// If the first day is Monday, second week starts on 8th
// Otherwise, calculate the first Monday and add 7 days
int secondWeekStartDay = 8 - dayOfWeek + 7;
// Calculate the start time of the second week
datetime secondWeekStartTime = D'2025.01.' + secondWeekStartDay;
return secondWeekStartTime;
} DislikedHi everyone, I'm looking for some help converting the "Trading Made Simple" EA from MQL4 to MQL5. I've run into several issues with MQL5 functions, and I'm hoping someone with MQL5 expertise could assist in porting the code while preserving its original logic and functionality. Thanks in advance for your help! {file}Ignored
Disliked{quote} Let me know if you need further adjustments or explanations. // Define parameters input int startDay = 1; // Starting day (you can change it) input int startMonth = 1; // Starting month input int startYear = 2025; // Starting year input bool fromSecondWeek = false; // If true, it starts from the 2nd week of the month void OnTick() { datetime startTime; // Calculate start time based on user input if (fromSecondWeek) { // Calculate second week of the month startTime = GetSecondWeekStartTime(startYear, startMonth); } else { // Use the provided...Ignored
Disliked{quote} Hi, I understand that you're looking to convert your "Trading Made Simple" EA from MQL4 to MQL5. However, based on the size of the code, this would be a very time-consuming task, as there are significant differences between MQL4 and MQL5 in terms of functions, syntax, and structure. It would require a detailed review of your entire code to properly port it while maintaining its original functionality. If you'd like, I can help you with specific issues you're encountering while working on the conversion or assist in parts of the code, but converting the entire EA could take some time. Hope this helps!Ignored
Disliked{quote} Please don't post shit you obviously don't understand. Your code isn't even an indicator. Are you an AI? You "talk" like a typical AI! {quote}Ignored
Disliked{quote} Hi, I understand your point, but just because I don't use the phrase 'Do not change the file name!!!
' doesn't mean I'm an AI.
I'm simply here to help, learn, and share. I appreciate constructive feedback, and let's keep the discussion friendly and productive!
Ignored
Dislikedwhat will be the correct way of completing this fuinction void sendCloseBuy() { } if i have used a bool constant bt to open a buy order, can i use this to close thast trade if(something) { OrderCloseBy(orderticket(),bt); return(0); }Ignored
Disliked{quote} It would depend on which Buys you wanted to close(magic number, etc), how many buys there might be (one or many) , the type of buy orders (open, stop, limit, etc...). Search for OrderReliable.mqh which provides functions such as opening, closing trades to include in your EA. Just read your extra question... If you have a ticket number you can use the OrderClose() function. Regards.Ignored
Disliked{quote} Let me know if you need further adjustments or explanations. // Define parameters input int startDay = 1; // Starting day (you can change it) input int startMonth = 1; // Starting month input int startYear = 2025; // Starting year input bool fromSecondWeek = false; // If true, it starts from the 2nd week of the month void OnTick() { datetime startTime; // Calculate start time based on user input if (fromSecondWeek) { // Calculate second week of the month startTime = GetSecondWeekStartTime(startYear, startMonth); } else { // Use the provided...Ignored
void sendBuy()
{
if (OrdersTotal() == 0)
{
if (OrderSend(Symbol(), OP_BUY, 1, Ask, 3, 0, 0, "My order", 16384, 0, clrGreen))
Print("Buy");
}
}
void sendSell()
{
if (OrdersTotal() == 0)
{
if (OrderSend(Symbol(), OP_SELL, 1, Bid, 3, 0, 0, "My order", 16384, 0, clrGreen))
Print("Sell");
}
}
void sendCloseBuy()
{
for (int cnt = OrdersTotal() - 1; cnt >= 0; cnt--)
{
if (OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES))
{
if (OrderType() == OP_BUY)
{
if (OrderClose(OrderTicket(), OrderLots(), Bid, 3, clrRed))
Print("Closed");
}
}
}
}
void sendCloseSell()
{
for (int cnt2 = OrdersTotal() - 1; cnt2 >= 0; cnt2--)
{
if (OrderSelect(cnt2, SELECT_BY_POS, MODE_TRADES))
{
if (OrderType() == OP_SELL)
{
if (OrderClose(OrderTicket(), OrderLots(), Ask, 3, clrRed))
Print("Closed");
}
}
}
} Disliked{quote} kindly correct the errors below void sendBuy() { if (OrdersTotal()==0) { if(OrderSend(Symbol(),OP_BUY,1,Ask,3,0,0,"My order",16384,0,clrGreen)) Print("Buy");} } void sendSell() { if (OrdersTotal()==0) { if(OrderSend(Symbol(),OP_SELL,1,Ask,3,0,0,"My order",16384,0,clrGreen)) Print("Sell");} } void sendCloseBuy() { for(int cnt=OrdersTotal()-1;cnt>=0;cnt--) { if(OrderSelect(cnt, SELECT_BY_POS,MODE_TRADES)) { if(OrderType()==OP_BUY) { if(OrderClose(OrderTicket(),OrderLots(),Bid,3,clrRed)) Print("Closed"); }}} } void sendCloseSell() { for(int...Ignored
DislikedHere are the corrected code: void sendBuy() { if (OrdersTotal() == 0) { if (OrderSend(Symbol(), OP_BUY, 1, Ask, 3, 0, 0, "My order", 16384, 0, clrGreen)) Print("Buy"); } } void sendSell() { if (OrdersTotal() == 0) { if (OrderSend(Symbol(), OP_SELL, 1, Bid, 3, 0, 0, "My order", 16384, 0, clrGreen)) Print("Sell"); } } void sendCloseBuy() { for (int cnt = OrdersTotal() - 1; cnt >= 0; cnt--) { if (OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES)) { if (OrderType() == OP_BUY) { if (OrderClose(OrderTicket(), OrderLots(), Bid, 3, clrRed)) Print("Closed");...Ignored
Dislikedcan someone please program a simple indicator (DTosc) of the system in the link below? it would just need arrows in the indicator window like here: {image} this is the thead with the system: https://www.forexfactory.com/thread/...indicator-that thank you! {file}Ignored
Dislikedcan someone please program a simple indicator (DTosc) of the system in the link below including as an option an alarm? it would just need arrows in the indicator window like here: {image} this is the thead with the system: https://www.forexfactory.com/thread/...indicator-that thank you! {file}Ignored
Disliked{quote} its an ex4 file, you cant see the code on those. We would need a mq4 fileIgnored