Fragen von Anfängern MQL5 MT5 MetaTrader 5 - Seite 626

 
Alexey Viktorov:


Wie klug von Ihnen, und so prägnant. Ich danke Ihnen.

 
Karputov Vladimir:
Dies ist eine Prüfung, um die Funktion PositionGetDouble zurückzugeben. Schlägt es fehl, wird 0 zurückgegeben, d.h. es ist ein Fehler.

Und ich verwende die zweite Form in Five, sie scheint mir zuverlässiger zu sein.

 
Alexey Volchanskiy:

Und ich verwende die zweite Form in den fünf, ich denke, sie ist zuverlässiger.

Und in einer Schleife.

do while(!PositiobGetDouble(POSITION_VOLUME, double_var);
Ich bin mir sicher, dass es nicht an mir vorbeigehen wird...
 

Dummkopf... :-)

Wie in expert über iCustom (), beziehen Sie sich auf die Werte der Variablen

double _Volume

и

int High_Low

dieses Indikators:

#property version   "1.00"
#property strict
#property indicator_chart_window
//+------------------------------------------------------------------+
//+------------------------------------------------------------------+

//+------------------------------------------------------------------+
int OnCalculate(const int rates_total,
                const int prev_calculated,
                const datetime &time[],
                const double &open[],
                const double &high[],
                const double &low[],
                const double &close[],
                const long &tick_volume[],
                const long &volume[],
                const int &spread[])
  {  
    long  Vol0 = iVolume(NULL,0,0);
    long  Vol1 = iVolume(NULL,0,1);
    long  Vol2 = iVolume(NULL,0,2);
    long  Vol3 = iVolume(NULL,0,3);
    long  Vol4 = iVolume(NULL,0,4);
    long  Vol5 = iVolume(NULL,0,5);
    long  Vol6 = iVolume(NULL,0,6);
    long  Vol7 = iVolume(NULL,0,7);
    long  Vol8 = iVolume(NULL,0,8);
    long  Vol9 = iVolume(NULL,0,9);
    long  Vol10= iVolume(NULL,0,10);

    double high1 = iHigh(NULL, 0, 1);
    double low1 =  iLow (NULL, 0, 1);    
    double high2 = iHigh(NULL, 0, 2);    
    double low2 =  iLow (NULL, 0, 2);
    double high3 = iHigh(NULL, 0, 3);    
    double low3 =  iLow (NULL, 0, 3);
    double high4 = iHigh(NULL, 0, 4);
    double low4 =  iLow (NULL, 0, 4);    
    double high5 = iHigh(NULL, 0, 5);    
    double low5 =  iLow (NULL, 0, 5);
    double high6 = iHigh(NULL, 0, 6);    
    double low6 =  iLow (NULL, 0, 6);
    double high7 = iHigh(NULL, 0, 7);
    double low7 =  iLow (NULL, 0, 7);    
    double high8 = iHigh(NULL, 0, 8);    
    double low8 =  iLow (NULL, 0, 8);
    double high9 = iHigh(NULL, 0, 9);    
    double low9 =  iLow (NULL, 0, 9);
    double high10 =iHigh(NULL, 0, 10);
    double low10 = iLow (NULL, 0, 10);    
    
    double _Volume = NormalizeDouble((Vol1+Vol2+Vol3+Vol4+Vol5+Vol6+Vol7+
                     Vol8+Vol9+Vol10)/10, _Digits);
    int High_Low = (int)((MathAbs(high1-low1)+MathAbs(high2-low2)+MathAbs(high3-low3)+
              MathAbs(high4-low4)+MathAbs(high5-low5)+MathAbs(high6-low6)+
              MathAbs(high7-low7)+MathAbs(high8-low8)+MathAbs(high9-low9)+
              MathAbs(high10-low10))/(10*Point));
   
   
   Alert(" Vol0 = ",Vol0,", Voll = ",Vol1,", Vol2 = ",Vol2,", Vol3 = ",Vol3,
     ", Vol4 = ",Vol4, ", Vol5 = ",Vol5, ", Vol6 = ",Vol6);
   Alert (" Vol7 = ",Vol7,", Vol8 = ",Vol8, ", Vol9 = ",Vol9, ", Vol10 = ",Vol10); 
   Alert("Cредний минутный объём за 10 мин. _Volume = ",_Volume);
   
   Alert("Среднее поминутное движение за 10 мин. High_Low = ",High_Low);  
   
  
   return(rates_total);
  }
//+------------------------------------------------------------------+
 
Roman Shiredchenko:

Dummkopf... :-)

Wie im Experten über iCustom (), beziehen Sie sich auf die Werte der Variablen

и

dieses Indikators:

Sie können es nicht direkt tun. Sie sollten den Variablenwert in den Indikatorpuffer schreiben und ihn von dort durch iCustom übernehmen
 
Andrey Barinov:
Sie können es nicht direkt tun. Sie müssen den Wert der Variablen in den Indikatorpuffer schreiben und ihn von dort durch iCustom übernehmen

Das ist verständlich... Vielleicht ein kurzes Beispiel für eine Variable und das war's... Obwohl es so aussieht, als würde ich dort selbst etwas in der Hilfe finden...

Ich danke Ihnen. Wie schreibt man sie in den Puffer, ich meine, welche Art von Puffer zu organisieren.... Sie brauchen keine Linien in diesem Indikator...

 
Wie kann ich die magische Zahl einer Marktorder in MQL4 ändern?
 
Alexey Volchanskiy:

Es gibt auch eine explizite Typkonvertierung:

Ich danke Ihnen! Wir werden es in Erwägung ziehen.
 
new-rena:
Wie kann ich eine magische Zahl für Marktaufträge in MQL4 ändern?
Auf keinen Fall, dasselbe gilt für Kommentare. Nur mit einer anderen magischen Zahl wieder öffnen
 
mila.com:

Hallo.

Bitte teilen Sie mir mit, wie ich das folgende Problem lösen kann.

Ein EA versucht, eine Position zu eröffnen, und der Server gibt eine Rückmeldung zurück.

Da es keinen EA-Code gibt, müssen wir von außen herausfinden, dass es einen Requote gab, und die gleiche Position um jeden Preis eröffnen.

Analysieren Sie nur Protokolldateien wie z. B. \logs\20160922.log. Aber wir können sie nicht von MQL4/5 abrufen, nur der Ordner \MQL5\Files ist zum Lesen/Schreiben verfügbar.

Wir müssen also ein externes Skript schreiben, das das Protokoll liest, es analysiert und MQL4/5 informiert, wenn eine Position geöffnet werden muss.

Oder es kopiert einfach das Protokoll einmal pro Sekunde in den Ordner Files, und von dort aus kann es mit MQL-Tools gelesen und analysiert werden

Grund der Beschwerde: