Fragen Sie! - Seite 37

 

Ich kann es nicht erreichen! Ich habe metatrader.info registriert, aber ich scheine noch keinen Zugang zu haben.

 

Ok habe es jetzt.... Hummm ich bin Anfänger in der Programmierung... Anweisung nicht sehr klar, was Teil des Codes benötigt, um zu bestehenden Indikator auf Kauf / Verkauf Signal wie die in asctrend_sound.mq4 hinzugefügt werden... Ich bekomme Kompilierungsfehler...

 

HALLO CG,

Ich denke, die Funktion sleep() kann nur in EA's aufgerufen werden. Gibt es eine ähnliche Funktion, die in benutzerdefinierten Indikatoren aufgerufen werden kann?

 

hey, codersguru!

Ich habe mir deine Lektionen angesehen und nichts über die Verwendung einer Include-Datei bemerkt. Das Konzept ist neu für mich, und ich habe mich gefragt, ob du etwas erklären könntest, was ich mit der Datei falsch machen könnte, und wie man sie verwendet.

Die Arbeit, die ich gemacht habe (mit 110 Fehlern?)

//+------------------------------------------------------------------------------------------+

//| Day Off.mq4.mq4 |

//| Eaglehawk |

//| https://www.forex-tsd.com/suggestions-trading-systems/3191-day-off-safety-detector.html |

//+------------------------------------------------------------------------------------------+

#property copyright "Eaglehawk"

#property link "https://www.forex-tsd.com/suggestions-trading-systems/3191-day-off-safety-detector.html"

//Global Variables

//I used variables to manually put in when Good Friday occurs, (I dont think it's possible to automate cycles of the moon, if you think so, go for it. I am, after all, a newcomer to coding )

extern int GoodFridaysMonth = 4; //Used to see what month Good Friday is in. (either 4 or 5)

extern int GoodFridaysDay = 12; //says the day of the month good friday is on.

bool DayOff = False; // the days interbankfx takes off

bool DayOffClose = False; //operates the last minute close if none of the minimization techniques are met by the deadline

//local variables (both used to determine what trend we are in)

double CurrentClose = iClose(NULL, 0, 1); //looks at the close of the most recent period

double TrendClose = iClose(NULL, 0, 3); //looks at the close of three periods

/*Counts the DayOff Function as true about two days before the time interbankfx is not running, (you can edit this to how fast you think your individual strategy will take to close)

In case this code is tampered with, the dates interbankfx takes off are here

New Years Day January 1

Martin Luther King Jr. Day January 20

Washington's Birthday February 17

Good Friday Friday before Easter

Memorial Day May 26

Independence Day July 4

Labor Day September 1

Thanksgiving Day Fourth Thurday of November

Christmas December 25*/

//DayOff variable tests

if ( Month() == 12 && Day() >= 30 || Month() == 1 && Day() <= 1 ) //New Years Day

{

DayOff = True;

}

if (Month() == 1 && (Day() >= 18 && Day() <= 20)) //Martin Luther King Jr. Day

{

DayOff = True;

}

if (Month() == 2 && (Day() >= 15 && Day() <= 17)) //Washington's Birthday

{

DayOff = True;

}

if (Month() == GoodFridaysMonth && (Day() = GoodFridaysDay - 2)) //Good Friday

{

DayOff = True;

}

if (Month() == 5 && (Day() >= 24 && Day() <= 26)) //Memorial Day

{

DayOff = True;

}

if (Month() == 7 && (Day() >= 2 && Day() <= 4)) //Independece Day

{

DayOff = True;

}

if ( Month() == 8 && Day() >= 30 || Month() == 9 && Day()== 1 ) //Labor Day

{

DayOff = True;

}

if (Month() == 11 && (DayOfWeek() >= 3 && DayOfWeek() =21) //Thanksgiving Day

{

DayOff = True;

}

if (Month() == 12 && (Day() >= 23 && Day() <= 25)) //Christmas Day

{

DayOff = True;

}

//DayOffClose variable tests, currently set to 9:00 P.M.

if (Month() == 12 && Day() == 31 && Hour() == 21) //New Years Day

{

DayOffClose = True;

}

if (Month() == 1 && (Day() == 19 && Hour() <= 21)) //Martin Luther King Jr. Day

{

DayOffClose = True;

}

if (Month() == 2 && Day() == 16 && Hour() == 21) //Washington's Birthday

{

DayOffClose = True;

}

if ( Month() == GoodFridaysMonth && Day() == GoodFridaysDay - 1 && Hour() == 21) //Good Friday

{

DayOffClose = True;

}

if (Month() == 5 && Day() == 25 && Hour() == 21) //Memorial Day

{

DayOffClose = True;

}

if (Month() == 7 && Day() == 3 && Hour() == 21) //Independece Day

{

DayOffClose = True;

}

if (Month() == 8 && Day()== 31 && Hour() == 21) //Labor Day

{

DayOffClose = True;

}

if (Month() == 11 && Day() >=21 && DayOfWeek() <=6) //Thanksgiving Day

{

DayOffClose = True;

}

if (Month() == 12 && Day() == 24 && Hour() == 21) //Christmas Day

{

DayOffClose = True;

}

//these next two functions will minimize loss on long, non-profitable trades before the close of interbankfx

if (DayOff == True && Ask-OrderOpenPrice() 0)

{

TrailingStopMode = True;

}

if (DayOff == True && Ask-OrderOpenPrice() < 0 && CurrentClose - TrendClose < 0)

{

Order = SIGNAL_CLOSEBUY;

}

//these next two functions will minimize loss on short, non-profitable trades before the close of interbankfx

if (DayOff == True && OrderOpenPrice()-Bid <0 && CurrentClose - TrendClose < 0)

{

TrailingStopMode = True;

}

if (DayOff == True && OrderOpenPrice()-Bid 0)

{

Order = SIGNAL_CLOSESELL;

}

//this next function will end all trades if not closed by 9:00 P.M. the day before the close of interbankfx

if (DayOffClose == True)

{

Order = SIGNAL_CLOSESELL;

}

if (DayOffClose == True)

{

Order = SIGNAL_CLOSEBUY;

}

//post this at the end of all your open Logics

if (/*your open logics*/ && DayOff == False) //order open

//post this as one of your exit short logics, closes trades when they are profitable

if (DayOff == True && OrderOpenPrice()-Bid >0)

{

Order = SIGNAL_CLOSESELL;

}

//post this as one of your exit long logics, also closes profitable trades.

if (DayOff == True && Ask-OrderOpenPrice() >0)

{

Order = SIGNAL_CLOSEBUY;

}

//+------------------------------------------------------------------+
 

Hallo! Ich möchte wissen, wie ich den oberen und unteren Rand des aktuellen Chart-Fensters ermitteln kann?

Gibt es eine Möglichkeit, den oberen und unteren Rand (in Pixel und Preis) des aktuellen Chart-Fensters zu ermitteln?

Und wie kann ich eine Timer-Prozedur mit Hilfe der Widows API in MetaTrader4 erstellen?

 

Ist es möglich, .NET DLL für MT4 zu verwenden?

Wie zu verwenden?

 

Es wäre schön, mehr Informationen über die Erstellung von Indikatoren zu haben, da EAs auf diesen basieren. Alpari hat einige gute Tutoren, aber sie sind auf Russisch:

http://www.alpari-idc.ru/ru/experts/articles/14.html

 

Period_Converter_opt Hilfe

"Ich verwende diesen Periodenkonverter, der an ein Diagramm angehängt ist, um benutzerdefinierte Diagramme in Echtzeit zu aktualisieren. Das funktioniert gut, aber wenn ich mehrere Charts desselben benutzerdefinierten Zeitrahmens öffne, wird nur ein Chart in Echtzeit aktualisiert. Die anderen Charts werden offline angezeigt und nur über das Aktualisierungsmenü aktualisiert. Wenn ich z. B. 2 oder 3 16M-Charts öffne, wird nur einer mit neuen Ticks aktualisiert; die anderen müssen manuell aktualisiert werden. Ist diese Einschränkung beabsichtigt? (Period_Converter_Opt) Gibt es irgendwelche Umgehungsmöglichkeiten für diese Situation? Hat jemand einen Vorschlag?"

Ich habe dies bereits in einem anderen Thread gepostet. Irgendwelche Ideen dazu?

Vielen Dank!

Diby

 

Zeitraum_Konverter_Opt Code

Erweiterung zum vorherigen Beitrag:

Ich habe mir den Code kurz angesehen und meine Frage wäre: was WindowHandle zurückgibt, wenn mehrere Fenster mit demselben Symbol und Zeitrahmen geöffnet sind.

if(hwnd == 0) {

//Versuch, das Chart-Fenster für die Aktualisierung des Offline-Fensters .... zu erkennen

hwnd = WindowHandle(Symbol(), NewPeriod);

}

Prost,

Diby

 

Buy 3 Sell 3 straddle script or EA - Any out there ?

Hallo CG und auch Newdigital, wenn Sie dabei sind.

Ich bin auf der Suche nach einem EA oder Skript, das, sobald ich die Parameter eingegeben habe, die oben genannten Geschäfte mit SL und TP auf den angegebenen Ebenen nur durch manuelle Eingabe eines Preisniveaus platziert.

Im Wesentlichen ein Straddle x 3.

Kennen Sie so etwas irgendwo?

Vielen Dank und Grüße,

Ian.