Aide au codage - page 326

 

Alerte au changement de direction

Bonjour,

Dans un EA qui achète, par exemple si MA10>MA20 (et vend en sens inverse), comment puis-je écrire une alerte si Achat et MA10<MA20 (et inverse) ?

Merci.

Jo

 
Jovager:
Bonjour,

Dans un EA qui achète, par exemple si MA10>MA20 (et vend à l'opposé), comment puis-je écrire une alerte si Achat et MA10<MA20 (et opposé) ?

Merci.

Jo

Essayez comme ceci :

if (MA10previousMA20) pour la première condition

if (MA10previous>MA20previous && MA10<MA20) pour la deuxième condition

 
mladen:
Si oui, c'est la cause : les alertes ne fonctionnent pas dans le back test.

Merci. C'était le cas auparavant, comme dans la version 509.

 
Big Be:
Merci. Ils fonctionnaient, comme dans la Build 509.

:) :)

Beaucoup de choses qui fonctionnaient auparavant ne fonctionnent plus dans ce "nouveau metatrader". Essayez le multi time frame en back test visuel et vous aurez un "amusement" pour le week-end.

 
mladen:
Cela me semble familier. Je vais vérifier s'il existe déjà

Une chance sur ce M. Mladen ...

Avez-vous réussi à le trouver ?

Merci

 
mladen:
Il y a beaucoup de choses qui fonctionnaient auparavant et qui ne fonctionnent plus dans ce "nouveau metatrader". Essayez le multi time frame en back test visuel et vous aurez un "amusement" pour le weekend

Bonjour Mladen

Je vois que vous êtes l'un de ces programmeurs serviables, alors je pourrais vous demander si vous pourriez éventuellement faire un EA à partir de l'indicateur ajouté. Celui-ci ne se repeint pas et délivre des signaux d'une qualité stupéfiante !

Dossiers :
 

Bonjour les gars, s'il vous plaît aidez à regarder ce code, ce qui peut être fait pour le rendre alerte et montrer des flèches sur la bougie actuelle.

Merci d'avance

// B83A886A5C437CCD9AC15473FD6F1788

void f0_2(string As_0) {

if (IsTesting() == FALSE && IsOptimization() == FALSE && IsVisualMode() == FALSE) SendMail(WindowExpertName(), As_0) ;

}

// A8CFDE6331BD59EB2AC96F8911C4B666

void f0_1(string A_name_0, string A_text_8, string A_fontname_16, int A_fontsize_24, color A_color_28, int A_y_32, int A_x_36, int A_corner_40, int A_bool_44) {

ObjectCreate(A_name_0, OBJ_LABEL, 0, 0, 0) ;

ObjectSetText(A_name_0, A_text_8, A_fontsize_24, A_fontname_16, A_color_28) ;

ObjectSet(A_name_0, OBJPROP_CORNER, A_corner_40) ;

ObjectSet(A_name_0, OBJPROP_XDISTANCE, A_x_36) ;

ObjectSet(A_name_0, OBJPROP_YDISTANCE, A_y_32) ;

ObjectSet(A_name_0, OBJPROP_BACK, A_bool_44) ;

}

// 085FEA7ABDC5D904FE69A3081EFD7398

void f0_0(string As_0, int GetBar) {

if (IsTesting() == FALSE && IsOptimization() == FALSE && IsVisualMode() == FALSE) {

if (sound) PlaySound("News.wav") ;

if (alert) Alert("Nouveau signal " + As_0+ " @ Symbol : "+Symbol()+" & Period : M "+Period()+" & Time : "+TimeToString(GetBar,TIME_MINUTES|TIME_SECONDS)) ;

if (email) f0_2("Nouveau signal " + As_0+ " @ Symbol : "+Symbol()+" & Period : M "+Period()+" & Time : "+TimeToString(GetBar,TIME_MINUTES|TIME_SECONDS)) ;

}

}

// BE8F80182E0C983916DA7338C2C1C040

int f0_3(string A_name_0, string A_name_8) {

if (ObjectFind(A_name_0) == -1) return (0) ;

if (ObjectFind(A_name_8) == -1) return (0) ;

if (ObjectGet(A_name_0, OBJPROP_XDISTANCE) > ObjectGet(A_name_8, OBJPROP_XDISTANCE) - 10.0 && ObjectGet(A_name_0, OBJPROP_XDISTANCE) < ObjectGet(A_name_8, OBJPROP_XDISTANCE) +

10.0) {

if (ObjectGet(A_name_0, OBJPROP_YDISTANCE) > ObjectGet(A_name_8, OBJPROP_YDISTANCE) - 10.0 && ObjectGet(A_name_0, OBJPROP_YDISTANCE) < ObjectGet(A_name_8, OBJPROP_YDISTANCE) +

10.0) return (1) ;

}

return (0) ;

}

// E4DB2306E8CC4DEB5830201DE61935CA

double f0_4() {

double Ld_ret_0 = 0 ;

for (int pos_8 = 0 ; pos_8 < OrdersTotal() ; pos_8++) {

if (OrderSelect(pos_8, SELECT_BY_POS, MODE_TRADES) == TRUE)

si (OrderSymbol() == Symbol()) Ld_ret_0 += OrderProfit() ;

}

return (Ld_ret_0) ;

}

// EA2B2676C28C0DB26D39331A336C6B92

int start() {

chaîne Ls_0 ;

double iatr_20 ;

double Ld_28 ;

double Ld_36 ;

int TimeBar=0 ;

si (f0_3("x", "r4") == 1) {

alert = FALSE ;

ObjectDelete("r2") ;

f0_1("x", "G", "Wingdings", 25, Rose, 160, 55, 1, FALSE) ;

PlaySound("Tick.wav") ;

G_time_192 = 0 ;

RefreshRates() ;

}

si (f0_3("x", "t4") == 1) {

sound = FALSE ;

ObjectDelete("t2") ;

f0_1("x", "G", "Wingdings", 25, Rose, 160, 55, 1, FALSE) ;

PlaySound("Tick.wav") ;

G_time_192 = 0 ;

RefreshRates() ;

}

if (f0_3("x", "u4") == 1) {

email = FALSE ;

ObjectDelete("u2") ;

f0_1("x", "G", "Wingdings", 25, Rose, 160, 55, 1, FALSE) ;

PlaySound("Tick.wav") ;

G_time_192 = 0 ;

RefreshRates() ;

}

si (f0_3("x", "r3") == 1) {

alert = TRUE ;

f0_1("r2", "þ", "Wingdings", 14, Red, 55, 65, 1, FALSE) ;

f0_1("x", "G", "Wingdings", 25, Rose, 160, 55, 1, FALSE) ;

PlaySound("Tick.wav") ;

G_time_192 = 0 ;

RefreshRates() ;

}

si (f0_3("x", "t3") == 1) {

son = VRAI ;

f0_1("t2", "þ", "Wingdings", 14, Red, 80, 65, 1, FALSE) ;

f0_1("x", "G", "Wingdings", 25, Rose, 160, 55, 1, FALSE) ;

PlaySound("Tick.wav") ;

G_time_192 = 0 ;

RefreshRates() ;

}

if (f0_3("x", "u3") == 1) {

email = VRAI ;

f0_1("u2", "þ", "Wingdings", 14, Red, 105, 65, 1, FALSE) ;

f0_1("x", "G", "Wingdings", 25, Pink, 160, 55, 1, FALSE) ;

PlaySound("Tick.wav") ;

G_time_192 = 0 ;

RefreshRates() ;

}

for (int index_8 = 0 ; index_8 < 100 ; index_8++) {

si (G_ibuf_108 < 1000.0) {

TimeBar=Time ;

Ls_0 = "BUY" ;

break ;

}

if (G_ibuf_112 < 1000.0) {

TimeBar=Time ;

Ls_0 = "SELL" ;

break ;

}

}

if (Ls_0 == "BUY" && ObjectDescription("Signal1") != "BUY") {

f0_0("BUY",TimeBar) ;

f0_1("Signal1", "BUY", "Wingdings 3", 30, White, 80, 32, 1, FALSE) ;

}

if (Ls_0 == "SELL" && ObjectDescription("Signal1") != "SELL") {

f0_0("SELL",TimeBar) ;

f0_1("Signal1", "SELL", "Wingdings 3", 30, White, 80, 25, 1, FALSE) ;

}

f0_1("r1", "Profit", "Arial", 10, Lime, 50, 80, 1, FALSE) ;

f0_1("Pr", DoubleToStr(f0_4(), 0), "Arial", 13, Yellow, 50, 35, 1, FALSE) ;

if (Time[0] == G_time_192) return (0) ;

G_time_192 = Time[0] ;

int Li_12 = Bars - IndicatorCounted() ;

si (IndicatorCounted() > 0) Li_12++ ;

for (int bars_16 = Bars ; bars_16 > 0 ; bars_16--) {

si (bars_16 <= HistoriBar) {

iatr_20 = iATR(NULL, 0, 100, 0) ;

Ld_28 = Close - iATR(NULL, 0, PeriodIndikator, bars_16) * Facteur ;

Ld_36 = Close + iATR(NULL, 0, PeriodIndikator, bars_16) * Facteur ;

si (Ld_28 > Gd_156 && Gi_180 == 1) Gd_156 = Ld_28 ;

si (Ld_36 < Gd_148 && Gi_180 == 2) Gd_148 = Ld_36 ;

si (Gd_156 !.= 0.0 && Gi_180 == 1) Gd_unused_124 = Gd_156 ;

si (Gd_148 != 1000.0 && Gi_180 == 2) Gd_unused_132 = Gd_148 ;

si (Close < Gd_156 && Gi_180 == 1) {

Gi_180 = 2 ;

si (bars_16 < HistoriBar / 2.0) G_ibuf_112 = High + iatr_20 ;

Gd_156 = 0 ;

}

if (Close > Gd_148 && Gi_180 == 2) {

Gi_180 = 1 ;

si (bars_16 < HistoriBar / 2.0) G_ibuf_108 = Low - iatr_20 ;

Gd_148 = 1000 ;

}

}

}

return (0) ;

}

// 52D46093050F38C27267BCE42543EF60

int deinit() {

 
wolfsch:
Bonjour Mladen, je vois que vous êtes l'un de ces programmeurs utiles, alors je vous demande si vous pouvez éventuellement faire un EA à partir de l'indicateur ajouté. Celui-ci ne se repeint pas et délivre de très bons signaux !

wolfsch

Je dois vous décevoir mais cet indicateur utilise l'indicateur T3 clean and snake. Maintenant, T3 ne se repeint pas. Mais "snake" est centré sur le tma et il recalcule, ce qui fait de cet indicateur un indicateur recalculant (qui se repeint).

PS : il s'agit en fait d'un indicateur renommé "T3 TMA combination" qui a ensuite été renommé en indicateur "uni cross". Vous trouverez plus d'informations à ce sujet ici : https://www.mql5.com/en/forum/general

 
emmany4:
Bonjour les gars, s'il vous plaît aidez à regarder ce code, ce qui peut être fait pour qu'il alerte et montre des flèches sur la bougie actuelle.

Merci d'avance

// B83A886A5C437CCD9AC15473FD6F1788

void f0_2(string As_0) {

if (IsTesting() == FALSE && IsOptimization() == FALSE && IsVisualMode() == FALSE) SendMail(WindowExpertName(), As_0) ;

}

// A8CFDE6331BD59EB2AC96F8911C4B666

void f0_1(string A_name_0, string A_text_8, string A_fontname_16, int A_fontsize_24, color A_color_28, int A_y_32, int A_x_36, int A_corner_40, int A_bool_44) {

ObjectCreate(A_name_0, OBJ_LABEL, 0, 0, 0) ;

ObjectSetText(A_name_0, A_text_8, A_fontsize_24, A_fontname_16, A_color_28) ;

ObjectSet(A_name_0, OBJPROP_CORNER, A_corner_40) ;

ObjectSet(A_name_0, OBJPROP_XDISTANCE, A_x_36) ;

ObjectSet(A_name_0, OBJPROP_YDISTANCE, A_y_32) ;

ObjectSet(A_name_0, OBJPROP_BACK, A_bool_44) ;

}

// 085FEA7ABDC5D904FE69A3081EFD7398

void f0_0(string As_0, int GetBar) {

if (IsTesting() == FALSE && IsOptimization() == FALSE && IsVisualMode() == FALSE) {

if (sound) PlaySound("News.wav") ;

if (alert) Alert("Nouveau signal " + As_0+ " @ Symbol : "+Symbol()+" & Period : M "+Period()+" & Time : "+TimeToString(GetBar,TIME_MINUTES|TIME_SECONDS)) ;

if (email) f0_2("Nouveau signal " + As_0+ " @ Symbol : "+Symbol()+" & Period : M "+Period()+" & Time : "+TimeToString(GetBar,TIME_MINUTES|TIME_SECONDS)) ;

}

}

// BE8F80182E0C983916DA7338C2C1C040

int f0_3(string A_name_0, string A_name_8) {

if (ObjectFind(A_name_0) == -1) return (0) ;

if (ObjectFind(A_name_8) == -1) return (0) ;

if (ObjectGet(A_name_0, OBJPROP_XDISTANCE) > ObjectGet(A_name_8, OBJPROP_XDISTANCE) - 10.0 && ObjectGet(A_name_0, OBJPROP_XDISTANCE) < ObjectGet(A_name_8, OBJPROP_XDISTANCE) +

10.0) {

if (ObjectGet(A_name_0, OBJPROP_YDISTANCE) > ObjectGet(A_name_8, OBJPROP_YDISTANCE) - 10.0 && ObjectGet(A_name_0, OBJPROP_YDISTANCE) < ObjectGet(A_name_8, OBJPROP_YDISTANCE) +

10.0) return (1) ;

}

return (0) ;

}

// E4DB2306E8CC4DEB5830201DE61935CA

double f0_4() {

double Ld_ret_0 = 0 ;

for (int pos_8 = 0 ; pos_8 < OrdersTotal() ; pos_8++) {

if (OrderSelect(pos_8, SELECT_BY_POS, MODE_TRADES) == TRUE)

si (OrderSymbol() == Symbol()) Ld_ret_0 += OrderProfit() ;

}

return (Ld_ret_0) ;

}

// EA2B2676C28C0DB26D39331A336C6B92

int start() {

chaîne Ls_0 ;

double iatr_20 ;

double Ld_28 ;

double Ld_36 ;

int TimeBar=0 ;

si (f0_3("x", "r4") == 1) {

alert = FALSE ;

ObjectDelete("r2") ;

f0_1("x", "G", "Wingdings", 25, Rose, 160, 55, 1, FALSE) ;

PlaySound("Tick.wav") ;

G_time_192 = 0 ;

RefreshRates() ;

}

si (f0_3("x", "t4") == 1) {

sound = FALSE ;

ObjectDelete("t2") ;

f0_1("x", "G", "Wingdings", 25, Rose, 160, 55, 1, FALSE) ;

PlaySound("Tick.wav") ;

G_time_192 = 0 ;

RefreshRates() ;

}

if (f0_3("x", "u4") == 1) {

email = FALSE ;

ObjectDelete("u2") ;

f0_1("x", "G", "Wingdings", 25, Rose, 160, 55, 1, FALSE) ;

PlaySound("Tick.wav") ;

G_time_192 = 0 ;

RefreshRates() ;

}

si (f0_3("x", "r3") == 1) {

alert = TRUE ;

f0_1("r2", "þ", "Wingdings", 14, Red, 55, 65, 1, FALSE) ;

f0_1("x", "G", "Wingdings", 25, Pink, 160, 55, 1, FALSE) ;

PlaySound("Tick.wav") ;

G_time_192 = 0 ;

RefreshRates() ;

}

si (f0_3("x", "t3") == 1) {

son = VRAI ;

f0_1("t2", "þ", "Wingdings", 14, Red, 80, 65, 1, FALSE) ;

f0_1("x", "G", "Wingdings", 25, Rose, 160, 55, 1, FALSE) ;

PlaySound("Tick.wav") ;

G_time_192 = 0 ;

RefreshRates() ;

}

if (f0_3("x", "u3") == 1) {

email = VRAI ;

f0_1("u2", "þ", "Wingdings", 14, Red, 105, 65, 1, FALSE) ;

f0_1("x", "G", "Wingdings", 25, Pink, 160, 55, 1, FALSE) ;

PlaySound("Tick.wav") ;

G_time_192 = 0 ;

RefreshRates() ;

}

for (int index_8 = 0 ; index_8 < 100 ; index_8++) {

si (G_ibuf_108 < 1000.0) {

TimeBar=Time ;

Ls_0 = "BUY" ;

break ;

}

if (G_ibuf_112 < 1000.0) {

TimeBar=Time ;

Ls_0 = "SELL" ;

break ;

}

}

if (Ls_0 == "BUY" && ObjectDescription("Signal1") != "BUY") {

f0_0("BUY",TimeBar) ;

f0_1("Signal1", "BUY", "Wingdings 3", 30, White, 80, 32, 1, FALSE) ;

}

if (Ls_0 == "SELL" && ObjectDescription("Signal1") != "SELL") {

f0_0("SELL",TimeBar) ;

f0_1("Signal1", "SELL", "Wingdings 3", 30, White, 80, 25, 1, FALSE) ;

}

f0_1("r1", "Profit", "Arial", 10, Lime, 50, 80, 1, FALSE) ;

f0_1("Pr", DoubleToStr(f0_4(), 0), "Arial", 13, Yellow, 50, 35, 1, FALSE) ;

if (Time[0] == G_time_192) return (0) ;

G_time_192 = Time[0] ;

int Li_12 = Bars - IndicatorCounted() ;

si (IndicatorCounted() > 0) Li_12++ ;

for (int bars_16 = Bars ; bars_16 > 0 ; bars_16--) {

si (bars_16 <= HistoriBar) {

iatr_20 = iATR(NULL, 0, 100, 0) ;

Ld_28 = Close - iATR(NULL, 0, PeriodIndikator, bars_16) * Facteur ;

Ld_36 = Close + iATR(NULL, 0, PeriodIndikator, bars_16) * Facteur ;

si (Ld_28 > Gd_156 && Gi_180 == 1) Gd_156 = Ld_28 ;

si (Ld_36 < Gd_148 && Gi_180 == 2) Gd_148 = Ld_36 ;

si (Gd_156 !.= 0.0 && Gi_180 == 1) Gd_unused_124 = Gd_156 ;

si (Gd_148 != 1000.0 && Gi_180 == 2) Gd_unused_132 = Gd_148 ;

si (Close < Gd_156 && Gi_180 == 1) {

Gi_180 = 2 ;

si (bars_16 < HistoriBar / 2.0) G_ibuf_112 = High + iatr_20 ;

Gd_156 = 0 ;

}

if (Close > Gd_148 && Gi_180 == 2) {

Gi_180 = 1 ;

si (bars_16 < HistoriBar / 2.0) G_ibuf_108 = Low - iatr_20 ;

Gd_148 = 1000 ;

}

}

}

return (0) ;

}

// 52D46093050F38C27267BCE42543EF60

int deinit() {

Bonjour Emmany4, si vous trouvez le code original de cet EA, vous pourriez probablement ajouter ou corriger les flèches et les alertes d'achat et de vente, mais cette version est décompilée.

 
mrtools:
Bonjour Emmany4, si vous trouvez le code original de cet EA, vous pourriez probablement ajouter ou corriger les flèches et les alertes d'achat et de vente, mais cette version est décompilée.

Pour autant que je sache, il s'agit d'un code décompilé incomplet d'une variation de la super tendance (celle qui utilise l'atr, pas la version cci). Rien d'autre. Quoi qu'il en soit, ce code tel quel ne peut pas fonctionner (de grandes parties sont manquantes).

Raison: