Zum Inhalt springen
View in the app

A better way to browse. Learn more.

#T/N/X/T

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Hilfe bei Fehlersuche bar-weise Scriptausführung

Geschrieben

Hi @ all,

 

da ich noch frischer Anfänger in MQL-Programmierung bin, ist der Fehler im Script vielleicht gar nicht so schwer zu finden, ich habe es aber in den letzten Stunden nicht geschafft. Und das, obwohl ich das Script extra ganz puristisch neu aufgebaut habe. Das Problem ist, dass die Print-Anweisungen nur einmal pro Bar ausgeführt werden sollen. Tatsächlich rattern die Prints nur so durch. Woanders funktioniert die Time[]-Methode bestens. Hier das Script:

 

int start()
 {
  //++++++++ tickweise Ausführung ++++++++
  //aktuellen Spread links oben einblenden
  Comment("Spread : ", (MarketInfo(Symbol(), MODE_SPREAD))/10, " Pips");
  
  //++++++++ barweise Ausführung ++++++++
  static datetime last_time = 0;
  if(last_time != Time[0]) {
  
     //Pinbar suchen
     if(IsPin(Open[1], High[1], Low[1], Close[1]) == true) {
       if(High[1] - Open[1] < Open[1] - Low[1]) {
         signal = 1;
       } else signal = 2;
     }  
  
  if(signal == 1) {
     Print("Longsignal bei ",Close[0]);
     signal = 0;
  }   
  if(signal == 2) {
     Print("Shortsignal bei ",Close[0]);
     signal = 0;
  }   

   }

  return(0);
 }

 

Hat jemand eine Idee?

Featured Replies

Geschrieben

Hat jemand eine Idee?

  if(last_time != Time[0]) {
     last_time = Time[0];          <==================================
     //Pinbar suchen
     if(IsPin(Open[1], High[1], Low[1], Close[1]) == true) {
       if(High[1] - Open[1] < Open[1] - Low[1]) {
         signal = 1;
       } else signal = 2;
     } 

Geschrieben
  • Autor

     last_time = Time[0];          <==================================

 

Ooops, ein simpler Copyblackout gepaart mit Betriebsblindheit. Naja, wenigstens schon kein typischer Anfängerfehler mehr ;)

 

Vielen Dank!

Dein Kommentar

Du kannst jetzt schreiben und Dich später registrieren. Wenn Du ein Konto hast, melde Dich jetzt an, um unter Deinem Benutzernamen zu schreiben.

Gast
Auf dieses Thema antworten...

Account

Navigation

Suche

Suche

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.