Demandez ! - page 37

 

Je ne peux pas l'atteindre ! J'ai enregistré metatrader.info mais il semble que je n'y ai pas encore accès.

 

Ok, je l'ai maintenant.... Hummm je suis novice en programmation... Les instructions ne sont pas très claires quant à la partie du code qui doit être ajoutée à l'indicateur existant sur le signal d'achat/vente comme celui dans asctrend_sound.mq4... J'obtiens des erreurs de compilation...

 

HI CG,

Je pense que la fonction sleep() ne peut être appelée que dans les EA's. Existe-t-il une fonction similaire disponible, qui peut être appelée dans un indicateur personnalisé. Merci.

 

hey, codersguru !

J'ai regardé vos leçons, et je n'ai rien remarqué sur l'utilisation d'un fichier include, le concept est nouveau pour moi, et je me demandais si vous pouviez m'expliquer ce que je pourrais faire de mal avec le fichier, et comment l'utiliser. peut-être faire une leçon sur les fichiers include ?

Le travail que j'ai fait, (avec 110 erreurs ?)

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

//| 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;

}

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

Bonjour, je voudrais savoir comment obtenir le haut et le bas de la fenêtre du graphique actuel ?

Existe-t-il un moyen d'obtenir le haut et le bas (en pixel et en prix) de la fenêtre du graphique en cours ?

De plus, comment créer une procédure de temporisation par l'API de Widows dans MetaTrader4 ?

 

Est-il possible d'utiliser une DLL .NET pour MT4 ?

Comment l'utiliser ?

 

Il serait bien d'avoir plus d'informations sur la création d'indicateurs puisque les EA sont basés sur ceux-ci. Alpari propose de bons tuteurs, mais ils sont en russe :

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

 

Period_Converter_opt aide

"J'utilise ce convertisseur de période attaché à un graphique pour mettre à jour les graphiques personnalisés en temps réel. Cela fonctionne parfaitement, sauf que si j'ouvre plusieurs graphiques de la même période personnalisée, seul un graphique est mis à jour en temps réel. L'autre graphique apparaît hors ligne et n'est mis à jour qu'avec l'option de rafraîchissement du menu. Par exemple, si j'ouvre 2 ou 3 graphiques 16M, un seul est mis à jour avec les nouveaux ticks ; les autres doivent être rafraîchis manuellement. Cette limitation est-elle voulue ? (Period_Converter_Opt) Existe-t-il des solutions de contournement pour cette situation ? Des suggestions, quelqu'un ?

J'ai déjà posté cette question dans un autre fil de discussion. Des idées à ce sujet ?

Merci,

Diby

 

Code du convertisseur_périodique_Opt

Extension au post précédent :

J'ai regardé le code brièvement et ma curosité serait : ce que retourne WindowHandle dans le cas de plusieurs fenêtres ouvertes avec le même symbole et la même période.

if(hwnd == 0) {

//essayer de détecter la fenêtre graphique pour mettre à jour la fenêtre hors ligne ....

hwnd = WindowHandle(Symbol(), NewPeriod) ;

}

Merci,

Diby

 

Acheter 3 Vendre 3 straddle script ou EA - Y en a-t-il ?

Bonjour CG et aussi Newdigital si vous êtes là.

Je suis à la recherche d'un EA ou d'un script qui, une fois que j'ai entré les paramètres, placera les trades ci-dessus avec SL et TP aux niveaux spécifiés juste en entrant manuellement un niveau de prix.

Essentiellement un straddle x 3.

Est-ce que vous en connaissez un ?

Merci et salutations,

Ian.