|
Startseite | Registrieren | Hilfe | Benutzerliste | Kalender | Suchen | Heutige Beiträge | Alle Foren als gelesen markieren |
Programmierung MQL4 Hier gehts rund ums Programmieren in MQL4. |
|
Themen-Optionen | Thema durchsuchen | Ansicht |
|
|||
Hilfe bei push - nachrichten
HEY Leute ich komm nicht mehr weiter:
Code:
if(MACD[i+] < 0 && MACD[i] > 0) PushNotifications("LONG",i); if(MACD[i+] > 0 && MACD[i] < 0) PushNotifications("SHORT",i); //+------------------------------------------------------------------+ //| Custom indicator iteration function PUSH_NOTIFICATION | //+------------------------------------------------------------------+ void PushNotifications(string PUSHTYPE ,int y) { static datetime Zeitstempel = Time[y]; if ( Zeitstempel != Time[0] ) // hier erfasst der EA, dass gerade eine neue Chartperiode begonnen hat. { Zeitstempel = Time[0]; // Angleichung der Variable, damit wieder die nächste Chartperiode erkannt werden kann. if(PUSHTYPE == "LONG") { SendNotification("SIGNAL: " + PUSHTYPE + " - " + Symbol() + " - " +TIMESTRING(Period()));} } } void PushNotifications(string PUSHTYPE, int shift) { int TimeCheck = 0; int TimeMark = iBarShift(Symbol(),PERIOD_CURRENT,lastAlertTime,0); if(shift <= 2 && TimeCheck != TimeMark) { TimeCheck = TimeMark; SendNotification("SIGNAL: " + PUSHTYPE + " - " + Symbol() + " - " +TIMESTRING(Period()));; Print("PushNotification send"); } } Danke schon mal im Vorraus |
|
|||
if(MACD[i+] < 0 && MACD[i] > 0) PushNotifications("LONG",i);
if(MACD[i+] > 0 && MACD[i] < 0) PushNotifications("SHORT",i); klar, bei jedem i wird gesendet! D.h. die Abfrage nach einer neuen Kerze vor die Sende-Funktion schreiben. traderdoc
__________________
Ich erfülle Euch gern Eure EA-, Indikator- und Script-Programmierungswünsche auf Honorarbasis. |
|
|||
also so ?
Code:
//+------------------------------------------------------------------+ //| SHARK_MACD_2021.mq4 | //| | //| | //+------------------------------------------------------------------+ #property icon "Shark.ico" #property indicator_separate_window #property indicator_buffers 1 #property indicator_level1 0 #property indicator_levelcolor clrDarkGray #property indicator_levelstyle DRAW_ZIGZAG //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ extern string SHARK_MACD_PARAMETER; extern int FAST_EMA = 12; extern int SLOW_EMA = 26; extern int MACD_SMA = 9; input ENUM_APPLIED_PRICE Shark_Price = PRICE_CLOSE; extern string Shark_MACD_ALERT; extern bool PUSH_MOBILE_ALERT = true; //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ double SHARK_BUFFER_M[]; datetime time_alert; int OnInit() { IndicatorBuffers(1); SetIndexBuffer(0,SHARK_BUFFER_M);SetIndexLabel(0,NULL);SetIndexStyle(0,DRAW_HISTOGRAM,STYLE_SOLID,3,clrSnow); return(INIT_SUCCEEDED); } int start() { int counted_bars=IndicatorCounted(),limit,i,r; if(counted_bars<0) return(-1); limit=Bars-counted_bars; for (i=limit, r=Bars-i-1; i>=0 && !IsStopped(); i--,r++) { SHARK_BUFFER_M[i] = iMACD(Symbol(),PERIOD_CURRENT,FAST_EMA,SLOW_EMA,MACD_SMA,Shark_Price,MODE_MAIN,i); if(SHARK_BUFFER_M[i+1] < 0 && SHARK_BUFFER_M[i] > 0 ) { if(i == 0 && Time[0] != time_alert) { myAlert("BUY"); time_alert = Time[0];} } if(SHARK_BUFFER_M[i+1] > 0 && SHARK_BUFFER_M[i] < 0 ) { if(i == 0 && Time[0] != time_alert) { myAlert("SELL"); time_alert = Time[0];} } } return(0); } void myAlert(string type) { if(type == "error") { Print(type+" | SHARK_MACD_2021 @ "+Symbol()+","+IntegerToString(Period())); } else if(type == "SELL") { if(PUSH_MOBILE_ALERT) SendNotification(type+" | SHARK_MACD_2021 @ "+Symbol()+","+IntegerToString(Period())); } else if(type == "BUY") { if(PUSH_MOBILE_ALERT) SendNotification(type+" | SHARK_MACD_2021 @ "+Symbol()+","+IntegerToString(Period())); } } Geändert von Sirocool (03.03.21 um 20:16 Uhr) |
|
|||
Und? Wie verhalten sich die Pushs?
traderdoc
__________________
Ich erfülle Euch gern Eure EA-, Indikator- und Script-Programmierungswünsche auf Honorarbasis. |
|
|||
?
Werde ich heute am 04.03.21 live sehen lass den heute mal testen. gestern der kurze test sah relativ gut aus
|
|
|||
So Fertig
Funktioniert einwandfrei mit allen jetzt
https://www.bilder-upload.eu/bild-20...71633.jpg.html https://www.bilder-upload.eu/bild-6f...71680.jpg.html |
Lesezeichen |
Themen-Optionen | Thema durchsuchen |
Ansicht | |
|
|