Hi,
Anybody help to add push notification in the following indicator.
Jasmine Brigit
Anybody help to add push notification in the following indicator.
Attached File(s)
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
Dislikedthis indicator is using current zigzag kindly change it to use previous zigzag thank you {file} {image}Ignored
/*-------------------------------------------------------------------- Change-log: ZigZagFibonacci_mod_PatienceFx_1 Date: 22-04-2025 By: MwlRCT -------------------------------------------------------------------- - Modified Fibonacci object to draw based on the previous ZigZag segment (using 2nd and 3rd most recent points instead of 1st and 2nd). - Updated object redraw trigger logic to depend only on changes in the 2nd or 3rd ZigZag points. - Added safety checks within point-finding loops to handle cases with insufficient (< 3) ZigZag points. - Corrected Fibonacci object time anchoring to use the actual time coordinates of the 2nd and 3rd points. --------------------------------------------------------------------*/
//+------------------------------------------------------------------+
//| fukinagashi |
//| Copyright :copyright: 2000-2007, MetaQuotes Software Corp. |
//| http://www.metaquotes.ru |
//+------------------------------------------------------------------+
//Modified, 2022/jan/06, by jeanlouie, www.forexfactory.com/jeanlouie
// - fib styling
// - fib ray off to x bars time width
//Modified, [CURRENT DATE], by [YOUR NAME] - Use Previous ZigZag Segment - Obj2/3/4
#property indicator_chart_window
#property indicator_buffers 1
#property indicator_color1 Red
//---- indicator parameters
extern int ExtDepth=12;
extern int ExtDeviation=5;
extern int ExtBackstep=3;
input int Fib_handle_bar_width = 5;
input color Fib_handle_clr = clrRed;
input int Fib_handle_width = 1;
input ENUM_LINE_STYLE Fib_handle_style = STYLE_DOT;
input color Fib_level_clr = clrYellow;
input int Fib_level_width = 1;
input ENUM_LINE_STYLE Fib_level_style = STYLE_SOLID;
input bool Fib_ray = true;
//---- indicator buffers
double ExtMapBuffer[];
double ExtMapBuffer2[];
int OldLastZigZag, OldPreviousZigZag, OldThirdZigZag; // MODIFIED: Added OldThirdZigZag
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
IndicatorBuffers(2);
//---- drawing settings
SetIndexStyle(0,DRAW_SECTION);
//---- indicator buffers mapping
SetIndexBuffer(0,ExtMapBuffer);
SetIndexBuffer(1,ExtMapBuffer2);
SetIndexEmptyValue(0,0.0);
ArraySetAsSeries(ExtMapBuffer,true);
ArraySetAsSeries(ExtMapBuffer2,true);
//---- indicator short name
IndicatorShortName("Fibodrawer");
//---- initialization done
return(0);
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
int deinit()
{
ObjectDelete("Fibo");
return 0;
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
int start()
{
int shift, back,lasthighpos,lastlowpos;
double val,res;
double curlow,curhigh,lasthigh,lastlow;
//----
for(shift=Bars-ExtDepth; shift>=0; shift--)
{
val=Low[Lowest(NULL,0,MODE_LOW,ExtDepth,shift)];
if(val==lastlow) val=0.0;
else
{
lastlow=val;
if((Low[shift]-val)>(ExtDeviation*Point)) val=0.0;
else
{
for(back=1; back<=ExtBackstep; back++)
{
res=ExtMapBuffer[shift+back];
if((res!=0)&&(res>val)) ExtMapBuffer[shift+back]=0.0;
}
}
}
ExtMapBuffer[shift]=val;
//--- high
val=High[Highest(NULL,0,MODE_HIGH,ExtDepth,shift)];
if(val==lasthigh) val=0.0;
else
{
lasthigh=val;
if((val-High[shift])>(ExtDeviation*Point)) val=0.0;
else
{
for(back=1; back<=ExtBackstep; back++)
{
res=ExtMapBuffer2[shift+back];
if((res!=0)&&(res<val)) ExtMapBuffer2[shift+back]=0.0;
}
}
}
ExtMapBuffer2[shift]=val;
}
// final cutting
lasthigh=-1; lasthighpos=-1;
lastlow=-1; lastlowpos=-1;
//----
for(shift=Bars-ExtDepth; shift>=0; shift--)
{
curlow=ExtMapBuffer[shift];
curhigh=ExtMapBuffer2[shift];
if((curlow==0)&&(curhigh==0)) continue;
//---
if(curhigh!=0)
{
if(lasthigh>0)
{
if(lasthigh<curhigh) ExtMapBuffer2[lasthighpos]=0;
else ExtMapBuffer2[shift]=0;
}
//---
if(lasthigh<curhigh || lasthigh<0)
{
lasthigh=curhigh;
lasthighpos=shift;
}
lastlow=-1;
}
//----
if(curlow!=0)
{
if(lastlow>0)
{
if(lastlow>curlow) ExtMapBuffer[lastlowpos]=0;
else ExtMapBuffer[shift]=0;
}
//---
if((curlow<lastlow)||(lastlow<0))
{
lastlow=curlow;
lastlowpos=shift;
}
lasthigh=-1;
}
}
for(shift=Bars-1; shift>=0; shift--)
{
if(shift>=Bars-ExtDepth) ExtMapBuffer[shift]=0.0;
else
{
res=ExtMapBuffer2[shift];
if(res!=0.0) ExtMapBuffer[shift]=res;
}
}
int i=0;
int LastZigZag, PreviousZigZag, ThirdZigZag; // MODIFIED: Added ThirdZigZag
int h=0;
// Find 1st point (Most Recent)
while( ExtMapBuffer[h]==0 && ExtMapBuffer2[h]==0)
{
h++;
if (h >= Bars) { ObjectDelete("Fibo"); return(0); } // ADDED: Safety break & object delete
}
LastZigZag=h;
h++; // Move to next bar index
// Find 2nd point (Previous)
while(ExtMapBuffer[h]==0 && ExtMapBuffer2[h]==0)
{
h++;
if (h >= Bars) { ObjectDelete("Fibo"); return(0); } // ADDED: Safety break & object delete
}
PreviousZigZag=h;
h++; // Move to next bar index
// Find 3rd point (Previous's Previous) - ADDED BLOCK
while(ExtMapBuffer[h]==0 && ExtMapBuffer2[h]==0)
{
h++;
if (h >= Bars) { ObjectDelete("Fibo"); return(0); } // ADDED: Safety break & object delete
}
ThirdZigZag=h; // ADDED: Assign third point index
if (OldPreviousZigZag!=PreviousZigZag || OldThirdZigZag!=ThirdZigZag)
{
OldPreviousZigZag=PreviousZigZag; // Keep: Update state for 2nd
OldThirdZigZag=ThirdZigZag; // ADDED: Update state for 3rd
ObjectDelete("Fibo");
// MODIFIED: Create Fibo using 3rd and 2nd point time/price anchors
ObjectCreate("Fibo", OBJ_FIBO, 0,
Time[ThirdZigZag], // Time of 3rd point
ExtMapBuffer[ThirdZigZag], // Price of 3rd point
Time[PreviousZigZag], // Time of 2nd point
ExtMapBuffer[PreviousZigZag] // Price of 2nd point
);
// Styling code remains the same
ObjectSetInteger(0,"Fibo",OBJPROP_COLOR,Fib_handle_clr);
ObjectSetInteger(0,"Fibo",OBJPROP_WIDTH,Fib_handle_width);
ObjectSetInteger(0,"Fibo",OBJPROP_STYLE,Fib_handle_style);
ObjectSetInteger(0,"Fibo",OBJPROP_RAY_RIGHT,Fib_ray);
// ObjectSetInteger(0,"Fibo",OBJPROP_RAY,Fib_ray); // OBJPROP_RAY is deprecated/less useful than RAY_RIGHT for Fibo
int levels = (int)ObjectGetInteger(0,"Fibo",OBJPROP_LEVELS);
for(int f=0; f<=levels; f++){
ObjectSetInteger(0,"Fibo",OBJPROP_LEVELCOLOR,f,Fib_level_clr);
ObjectSetInteger(0,"Fibo",OBJPROP_LEVELSTYLE,f,Fib_level_style);
ObjectSetInteger(0,"Fibo",OBJPROP_LEVELWIDTH,f,Fib_level_width);
}
}
return 0;
}
//+------------------------------------------------------------------+
/*--------------------------------------------------------------------
[b]Change-log[/b]: ZigZagFibonacci_mod_PatienceFx_1
Date: 22-04-2025
By: MwlRCT
--------------------------------------------------------------------
- Modified Fibonacci object to draw based on the previous ZigZag segment (using 2nd and 3rd most recent points instead of 1st and 2nd).
- Updated object redraw trigger logic to depend only on changes in the 2nd or 3rd ZigZag points.
- Added safety checks within point-finding loops to handle cases with insufficient (< 3) ZigZag points.
- Corrected Fibonacci object time anchoring to use the actual time coordinates of the 2nd and 3rd points.
--------------------------------------------------------------------*/ DislikedHi, Anybody help to add push notification in the following indicator.{file}{file} Jasmine BrigitIgnored
/*-------------------------------------------------------------------- Change-log: trendline price alert v1.5 Date: 04-22-2025 By: MwlRCT -------------------------------------------------------------------- - Added input `ALERTBAR` to control alert timing (0 = Immediate, 1 = On New Bar Open). - Added inputs `AlertsSound`, `AlertsMobile`, and `SoundFile` for enhanced alert configuration. - Renamed input `MsgAlerts` to `AlertsMessage`. - Renamed input `eMailAlerts` to `AlertsEmail`. - Implemented sound alerts using `PlaySound(SoundFile)` based on `AlertsSound` flag. - Implemented mobile push notifications using `SendNotification()` based on `AlertsMobile` flag. - Implemented `ALERTBAR` logic using `static datetime` to trigger alerts on new bar open when set to 1. - Fixed bug where `triggerAlert` flag was not reset per object, ensuring correct alert timing for each object independently. - Fixed minor trailing comma issue in `ActivTF` function output string. --------------------------------------------------------------------*/
//+------------------------------------------------------------------+
//| trendline price alert v1.5.mq4 |
//| superzeeshan |
//+------------------------------------------------------------------+
//MOD by Chris Merciless 2013-09-11
//
// Added ChangeColour setting to allow user to decide if colour should be changed.
// De-obfuscated code for easier reading...
#property copyright "superzeeshan"
#property indicator_chart_window
extern double Distance = 1.0; // Distance from price to trigger alert (in points)
extern bool ChangeColour = true; // Change line color on alert?
extern color ColorOfHitsLevel = clrYellow; // Color to change line to
// --- Alert Settings ---
extern int ALERTBAR = 0; // Alert Timing: 0 = Immediate, 1 = On New Bar Open
extern bool AlertsMessage = true; // Enable Pop-up Message Alerts?
extern bool AlertsSound = true; // Enable Sound Alerts?
extern bool AlertsEmail = false; // Enable Email Alerts?
extern bool AlertsMobile = false; // Enable Mobile Push Alerts?
extern string SoundFile = "alert2.wav"; // Sound file for alerts
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
Comment("");
if(Digits == 3 || Digits == 5)
{
Distance *= 10;
}
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
Comment("");
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
static datetime alertedBarTime = 0;
string objName;
string alertMsgBase;
string alertMsgFull;
double CurrValue;
bool isNewBar = (Time[0] != alertedBarTime);
if(isNewBar)
{
alertedBarTime = Time[0];
}
for(int t = ObjectsTotal() - 1; t >= 0; t--)
{
objName = ObjectName(t);
if(ObjectType(objName) == OBJ_VLINE || ObjectType(objName) > OBJ_TRENDBYANGLE)
{
continue;
}
if(StringFind(ObjectDescription(objName)," DONE!!!", 0) < 0)
{
bool triggerAlert = false;
if(ObjectType(objName) == OBJ_HLINE)
{
CurrValue = ObjectGet(objName, OBJPROP_PRICE1);
}
else
{
CurrValue = ObjectGetValueByShift(objName, 0);
}
if(MathAbs(Bid - CurrValue) <= Distance*Point)
{
if(ALERTBAR == 0)
{
triggerAlert = true;
}
else if(ALERTBAR == 1 && isNewBar)
{
triggerAlert = true;
}
if(triggerAlert)
{
alertMsgBase = Symbol() + " " + ActivTF(ObjectGet(objName, OBJPROP_TIMEFRAMES)) + " Price " + DoubleToStr(Bid, Digits);
alertMsgFull = alertMsgBase + ": " + ObjectDescription(objName);
if(AlertsMessage)
{
Alert(alertMsgFull);
}
if(AlertsEmail)
{
SendMail(Symbol() + " Alert", alertMsgFull);
}
if(AlertsMobile)
{
SendNotification(alertMsgFull);
}
if(AlertsSound && SoundFile != "")
{
PlaySound(SoundFile);
}
string temptxt = ObjectDescription(objName);
if (StringFind(temptxt, " DONE!!!", 0) < 0)
{
ObjectSetText(objName, temptxt + " DONE!!!", 10);
}
if(ChangeColour)
{
ObjectSet(objName, OBJPROP_COLOR, ColorOfHitsLevel);
}
}
}
}
}
//----
return(0);
}
//+------------------------------------------------------------------+
//| ActivTF |
//+------------------------------------------------------------------+
string ActivTF(int tf)
{
string strTF[11]= {"","M1","M5","M15","M30","H1","H4","D1","W1","MN1"}, actTF;
int intTF[11]= {0,1,2,4,8,16,32,64,128,256}, tmpTF;
if(tf == 0)
{
return(PerToStr(Period()));
}
tmpTF = tf;
for(int i = 9; i >= 1; i--)
{
if(tmpTF >= intTF[i])
{
tmpTF = tmpTF - intTF[i];
actTF = actTF + strTF[i] + ", ";
}
if(tmpTF == 0)
{
break;
}
}
return(actTF);
}
//+------------------------------------------------------------------+
//| PerToStr |
//+------------------------------------------------------------------+
string PerToStr(int p)
{
string Result = "";
switch(p)
{
case PERIOD_M1 :
{ Result = "M1 "; break; }
case PERIOD_M5 :
{ Result = "M5 "; break; }
case PERIOD_M15:
{ Result = "M15"; break; }
case PERIOD_M30:
{ Result = "M30"; break; }
case PERIOD_H1 :
{ Result = "H1 "; break; }
case PERIOD_H4 :
{ Result = "H4 "; break; }
case PERIOD_D1 :
{ Result = "D1 "; break; }
case PERIOD_W1 :
{ Result = "W1 "; break; }
case PERIOD_MN1:
{ Result = "MN1"; break; }
default :
{ Result = "Undefined"; break; }
}
return(Result);
}
//+------------------------------------------------------------------+
/*--------------------------------------------------------------------
Change-log: trendline price alert v1.5
Date: 04-22-2025
By: MwlRCT
--------------------------------------------------------------------
- Added input `ALERTBAR` to control alert timing (0 = Immediate, 1 = On New Bar Open).
- Added inputs `AlertsSound`, `AlertsMobile`, and `SoundFile` for enhanced alert configuration.
- Renamed input `MsgAlerts` to `AlertsMessage`.
- Renamed input `eMailAlerts` to `AlertsEmail`.
- Implemented sound alerts using `PlaySound(SoundFile)` based on `AlertsSound` flag.
- Implemented mobile push notifications using `SendNotification()` based on `AlertsMobile` flag.
- Implemented `ALERTBAR` logic using `static datetime` to trigger alerts on new bar open when set to 1.
- Fixed bug where `triggerAlert` flag was not reset per object, ensuring correct alert timing for each object independently.
- Fixed minor trailing comma issue in `ActivTF` function output string.
--------------------------------------------------------------------*/ Disliked{quote} -- BEFORE: XAUUSD-M5 {image} -- AFTER: XAUUSD-M5 {image} -- ChangeLog: /*-------------------------------------------------------------------- Change-log: ZigZagFibonacci_mod_PatienceFx_1 Date: 22-04-2025 By: MwlRCT -------------------------------------------------------------------- - Modified Fibonacci object to draw based on the previous ZigZag segment (using 2nd and 3rd most recent points instead of 1st and 2nd). - Updated object redraw trigger logic to depend only on changes in the 2nd or 3rd ZigZag points. - Added safety checks within...Ignored
Disliked{quote} --- Done: - Implemented mobile push notifications using `SendNotification()` based on `AlertsMobile` flag. -- Changelog: /*-------------------------------------------------------------------- Change-log: trendline price alert v1.5 Date: 04-22-2025 By: MwlRCT -------------------------------------------------------------------- - Added input `ALERTBAR` to control alert timing (0 = Immediate, 1 = On New Bar Open). - Added inputs `AlertsSound`, `AlertsMobile`, and `SoundFile` for enhanced alert configuration. - Renamed input `MsgAlerts` to `AlertsMessage`....Ignored
Disliked{quote}i think, you don't have enough history to calculate the indicator for this pair!? increase the bars in MT4 history: Tools -> Options -> Charts -> Max bars in history/chart, then.. open the pair-chart: press the Home but-key for 10-15 seconds: throw the induk on the chart... or alternative induks - exactly the same Zigzag, only without Triangles.. but the functionality is wider
ZZ NRP TR HA AA LB TT [x3] ZZ NRP TR HA AA LB TT [x3] sw {file} {file} {image} {image} {image}
Ignored
DislikedDear readers, Is there anyone here who can help with the following problem? When I put an EA on a chart, it immediately disappears again and gets the following error message in the journal: 2025.04.22 09:37:40.798 Experts initializing of Slope EA Mt5 (US30,M5) failed with code -1 Thanks in advance.Ignored
Disliked{quote} i tested this EA,it doesnt work properly,it doesnt close by symbol it is attached to, it closes all trades in the account.it doesnt clelete pending orders,so it is not useful for me,please would you code an EA that has following features as under: 1.Profitable trades close at account balance percent 2.delete pending orders 3.disable auto tradingIgnored
//--- Inputs: Account Profit Settings input string ProfitSettings_Header = "--- Profit Target Settings ---"; // Profit Target Settings input bool UseProfitPercent = true; // Use Percentage Target? (If false, uses Fixed Amount) input double ProfitPercentToClose = 1.0; // Close trades if symbol profit hits X% of balance input double ProfitAmountToClose = 100.0; // Close trades if symbol profit hits $X.XX (used if UseProfitPercent=false) //--- Inputs: Order Management Filters input string ManagementSettings_Header = "--- Management Toggles ---"; // Management Toggles input bool ManageMarketOrders = true; // Enable Closing Profitable Market Orders? input bool DeletePendingOrders = true; // Enable Deleting Pending Orders? input bool DisableAutoTradingOnProfit = false; // Alert user to disable AutoTrading on profit? //--- Inputs: Order Execution Settings input string ExecutionSettings_Header = "--- Execution Settings ---"; // Execution Settings input int Slippage = 3; // Slippage in points for OrderClose
Disliked{quote} --- Do you have extra suggestions on input parameters, For now EA will have this: //--- Inputs: Account Profit Settings input string ProfitSettings_Header = "--- Profit Target Settings ---"; // Profit Target Settings input bool UseProfitPercent = true; // Use Percentage Target? (If false, uses Fixed Amount) input double ProfitPercentToClose = 1.0; // Close trades if symbol profit hits X% of balance input double ProfitAmountToClose = 100.0; // Close trades if symbol profit hits $X.XX (used if UseProfitPercent=false) //--- Inputs: Order Management...Ignored
Disliked{quote} --- The error message Experts initializing of Slope EA Mt5 (US30,M5) failed with code -1 is quite specific in the MQL5 context. It means the Expert Advisor failed during its OnInit() function, which is the critical setup phase executed once when the EA is first loaded onto the chart. Failure here prevents the EA from running. Since you haven't provided the Code (.mq5 file for the "Slope EA Mt5"), I cannot pinpoint the exact line causing the failure.Ignored
Disliked{quote} -- BEFORE: XAUUSD-M5 {image} -- AFTER: XAUUSD-M5 {image} -- ChangeLog: /*-------------------------------------------------------------------- Change-log: ZigZagFibonacci_mod_PatienceFx_1 Date: 22-04-2025 By: MwlRCT -------------------------------------------------------------------- - Modified Fibonacci object to draw based on the previous ZigZag segment (using 2nd and 3rd most recent points instead of 1st and 2nd). - Updated object redraw trigger logic to depend only on changes in the 2nd or 3rd ZigZag points. - Added safety checks within...Ignored
Disliked{quote} Thanks for your response Dear MwIRCT. It's strange because the same EA on my live account/platform instead of my Demo is doing well. Regards. {file}Ignored
Disliked{quote} --- Do you have extra suggestions on input parameters, For now EA will have this: //--- Inputs: Account Profit Settings input string ProfitSettings_Header = "--- Profit Target Settings ---"; // Profit Target Settings input bool UseProfitPercent = true; // Use Percentage Target? (If false, uses Fixed Amount) input double ProfitPercentToClose = 1.0; // Close trades if symbol profit hits X% of balance input double ProfitAmountToClose = 100.0; // Close trades if symbol profit hits $X.XX (used if UseProfitPercent=false) //--- Inputs: Order Management...Ignored
Disliked{quote} You are getting -1 OnInit() because the iCustom() handles can't be created, most likely because you don't have the required indicator with this name: {image} {image} PS. There is nothing in the code about live or demo accounts...Ignored
Dislikedplease suggest a fib indicator with button ( one day high low )Ignored