Fonction ICustom - page 22

 
SantaClaus:
L'anglais n'est pas ma langue maternelle mais je ne pensais vraiment pas que ma question était si fausse. Au lieu de "marquer des mots", trouvons une solution à mon problème. Je réessaie la question.

Quelle est la meilleure façon pour mon EA de reconnaître les simples puts et calls de mon indicateur ?

De toute évidence, mon code n'a pas fonctionné et j'ai essayé de remplacer le "1" par un "0" comme vous me l'avez demandé.

Postez (attachez) votre code qui ne fonctionne pas ici - les fichiers mql que vous testez et que vous avez écrits jusqu'à présent.

 

C'est mon code privé et je ne veux pas le partager. Mais qu'avez-vous besoin de voir de plus que le code que je vous ai fourni ?

Y a-t-il quelque chose que j'ai oublié ?

 
SantaClaus:
C'est mon code privé et je ne veux pas le partager. Mais qu'avez-vous besoin de voir de plus que le code que j'ai fourni ? Y a-t-il quelque chose que j'ai oublié ?

Vous voulez dire que vous voulez que quelqu'un vous aide à coder, mais vous ne voulez pas montrer le code pour qu'il soit vérifié pour les erreurs, mais au lieu de cela vous prétendez que tous les conseils que vous avez reçus, et qui fonctionnent dans des milliers et des milliers d'autres codes, ne fonctionnent pas pour vous ?

D'ACCORD. Je comprends maintenant votre position. Bonne chance avec votre codage

Bon trading

 

Un code privé qui ne fonctionne pas ? Intéressant

 

Deux de mes messages ont été supprimés pour une raison que j'ignore.

Cependant, le problème rencontré était que j'avais d'autres tampons qui perturbaient celui que j'essayais de lire. J'ai maintenant une solution qui fonctionne.

 

J'ai besoin d'aide s'il vous plaît... Comment envoyer des paramètres de symbole qui ont un suffixe (micro) à une fonction contenant icustom. Si je n'utilise pas de fonction, je mets le nom du symbole entre guillemets et cela fonctionne, par exemple icustom("EURUSDmicro",0,channel-signal",2,1), mais lorsque j'utilise une fonction, les guillemets ne sont pas transmis.

void OnTick()

{

CalcDisplay("EURUSDmicro") ; //--------FUNCTION CALL-------

}

void CalcDisplay(string TxtCurrency) //--------FUNCTION-------

{

double Value=icustom(TxtCurrency,0,channel-signal",2,1) ;

...

...

..

}

 
Richard Sidric:
J'ai besoin d'aide s'il vous plaît. Comment envoyer des paramètres de symbole qui ont un suffixe (micro) à une fonction contenant icustom. Si je n'utilise pas de fonction, je mets le nom du symbole entre guillemets et cela fonctionne, par exemple icustom("EURUSDmicro",0,channel-signal",2,1), mais lorsque j'utilise une fonction, les guillemets ne sont pas transférés.

void OnTick()

{

CalcDisplay("EURUSDmicro") ; //--------FUNCTION CALL-------

}

void CalcDisplay(string TxtCurrency) //--------FUNCTION-------

{

double Value=icustom(TxtCurrency,0,channel-signal",2,1) ;

...

...

..

}

Vous n'avez pas besoin de passer les guillemets. Il suffit qu'il s'agisse d'une chaîne de caractères.

___________________

PS : dans votre appel iCiustom, il vous manque une citation. C'est comme ça maintenant :

double Value=icustom(TxtCurrency,0,channel-signal",2,1) ;

et doit être comme ceci :

double Value=icustom(TxtCurrency,0, "channel-signal",2,1) ;

 

Bonjour à tous, j'ai un indicateur t4 ci-dessous attaché juste je veux savoir comment je peux l'utiliser pour le robo trading et le robo trading ou l'ea sont les mêmes ou pas.

( je l'utilise déjà en trading manuel, assis devant l'ordinateur mais)

Si je l'utilise pour le trading automatisé, comment puis-je l'utiliser ? Merci d'avance.

//------------------------------------------------------------------

// original ised et première implémentation par mony

// version tris par mladen

//------------------------------------------------------------------

#property copyright "mony & mladen"

#property link "made at www.forex.tsd.com"

#property indicator_chart_window

#property indicator_buffers 5

#property indicator_color1 MediumBlue

#property indicator_color2 Red

#property indicateur_color3 MediumBlue

#property indicator_color4 Red

#property indicator_color5 Red

#property indicator_width3 3

#property indicator_width4 3

#property indicator_width5 3

#property strict

//

//

//

//

//

//

enum enDisplay

{

dis_line, // Affichage d'une ligne colorée

dis_bars, // Affichage de barres colorées

dis_both // Affiche à la fois les lignes et les barres colorées

} ;

extern int CCIperiod = 3 ; // Période CCI

extern int ATRperiod = 300 ; // Période ATR

extern ENUM_APPLIED_PRICE applied_price = PRICE_TYPICAL ; // Prix à utiliser

extern enDisplay DisplayType = dis_line ; // Type d'affichage

extern bool alertsOn = true ; // Activation des alertes

extern bool alertsOnCurrent = false ; // Alertes sur la barre actuelle (encore ouverte)

extern bool alertsMessage = true ; // Les alertes doivent afficher un message pop-up

extern bool alertsSound = true ; // Les alertes doivent jouer un son

extern bool alertsNotify = true ; // Les alertes doivent envoyer une notification

extern bool alertsEmail = false ; // Les alertes doivent envoyer un courrier électronique.

extern string soundFile = "o.wma" ; // Fichier son à utiliser pour les alertes sonores

double TrLine[] ;

double TrendDowna[] ;

double TrendDownb[] ;

double HistUp[] ;

double HistDn[] ;

double trend[] ;

//------------------------------------------------------------------

//

//------------------------------------------------------------------

//

//

//

//

//

int init()

{

IndicatorBuffers(6) ;

int styleLine = DRAW_LINE ; if (DisplayType==dis_bars) styleLine=DRAW_NONE ;

int styleBars = DRAW_HISTOGRAM ; if (DisplayType==dis_line) styleBars=DRAW_NONE ;

SetIndexBuffer(0, HistUp) ; SetIndexStyle(0,styleBars) ;

SetIndexBuffer(1, HistDn) ; SetIndexStyle(1,styleBars) ;

SetIndexBuffer(2, TrLine) ; SetIndexStyle(2,styleLine) ;

SetIndexBuffer(3, TrendDowna) ; SetIndexStyle(3,styleLine) ;

SetIndexBuffer(4, TrendDownb) ; SetIndexStyle(4,styleLine) ;

SetIndexBuffer(5, trend) ;

return(0) ;

}

int deinit(){ return(0) ; }

//------------------------------------------------------------------

//

//------------------------------------------------------------------

//

//

//

//

//

int start()

{

int counted_bars=IndicatorCounted() ;

if(counted_bars<0) return(-1) ;

if(counted_bars>0) counted_bars-- ;

int limit = MathMin(Bars-counted_bars,Bars-1) ;

//

//

//

//

//

si (trend[limit]==-1) CleanPoint(limit,TrendDowna,TrendDownb) ;

for(int i=limite ; i >= 0 ; i--)

{

double cciTrendNow = iCCI(NULL, 0, CCIperiod, applied_price, i) ;

si (cciTrendNow >= 0)

{

TrLine = NormalizeDouble(Low - iATR(NULL, 0, ATRperiod, i),Digits) ;

si (i<(Bars-1) && TrLine < TrLine) TrLine = TrLine ;

}

si (cciTrendNow <= 0)

{

TrLine = NormalizeDouble(High + iATR(NULL, 0, ATRperiod, i),Digits) ;

if (i TrLine) TrLine = TrLine ;

}

//

//

//

//

//

TrendDowna = EMPTY_VALUE ;

TrendDownb = EMPTY_VALUE ;

si (i<(Bars-1))

{

trend = trend ;

si (TrLine> TrLine) trend = 1 ;

si (TrLine< TrLine) trend =-1 ;

si (trend == -1) PlotPoint(i,TrendDowna,TrendDownb,TrLine) ;

si (trend == 1) { HistUp = High ; HistDn = Low ; }

si (trend == -1) { HistDn = High ; HistUp = Low ; }

}

}

manageAlerts() ;

return(0) ;

}

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

//|

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

//

//

//

//

//

void manageAlerts()

{

if (alertsOn)

{

int whichBar = 1 ; if (alertsOnCurrent) whichBar = 0 ;

if (trend[whichBar] != trend[whichBar+1])

{

si (trend[whichBar] == 1) doAlert(whichBar, "up") ;

si (trend[whichBar] ==-1) doAlert(whichBar, "down") ;

}

}

}

//

//

//

//

//

void doAlert(int forBar, string doWhat)

{

static string previousAlert="rien" ;

static datetime previousTime ;

message de type chaîne de caractères ;

if (previousAlert != doWhat || previousTime != Time[forBar]) {

previousAlert = doWhat ;

previousTime = Time[forBar] ;

//

//

//

//

//

message = Symbol()+" à "+TimeToStr(TimeLocal(),TIME_SECONDS)+" SP MA tendance a changé en "+doWhat ;

if (alertsMessage) Alert(message) ;

if (alertsNotify) SendNotification(message) ;

if (alertsEmail) SendMail(Symbol()+" S P MY",message) ;

if (alertsSound) PlaySound(soundFile) ;

}

}

//-------------------------------------------------------------------

//

//-------------------------------------------------------------------

//

//

//

//

//

void CleanPoint(int i,double& first[],double& second[])

{

if (i>=Bars-3) return ;

si ((second != EMPTY_VALUE) && (second != EMPTY_VALUE))

second = EMPTY_VALUE ;

sinon

if ((first != EMPTY_VALUE) && (first != EMPTY_VALUE) && (first == EMPTY_VALUE))

first = EMPTY_VALUE ;

}

void PlotPoint(int i,double& first[],double& second[],double& from[])

{

si (i>=Bars-2) retour ;

si (first == EMPTY_VALUE)

if (first == EMPTY_VALUE)

{ first = from ; first = from ; second = EMPTY_VALUE ; }

else { second = from ; second = from ; first = EMPTY_VALUE ; }

else { first = from ; second = EMPTY_VALUE ; } }

}

s_p_mony__alerts_1.01.mq4

Dossiers :
 
mony:
bonjour a tous j'ai un indicateur t4 ci-dessous attaché juste je veux savoir comment je peux l'utiliser pour le robo trading et le robo trading ou l'ea sont les mêmes ou pas

( je l'utilise déjà en trading manuel, assis devant l'ordinateur mais)

si je l'utilise pour le trading automatisé alors comment faire s'il vous plaît aidez-moi quelqu'un merci d'avance

//------------------------------------------------------------------

// original ised et première implémentation par mony

// version tris par mladen

//------------------------------------------------------------------

#property copyright "mony & mladen"

#property link "made at www.forex.tsd.com"

#property indicator_chart_window

#property indicator_buffers 5

#property indicator_color1 MediumBlue

#property indicator_color2 Red

#property indicator_color3 MediumBlue

#property indicator_color4 Red

#property indicator_color5 Red

#property indicator_width3 3

#property indicator_width4 3

#property indicator_width5 3

#property strict

//

//

//

//

//

//

enum enDisplay

{

dis_line, // Affichage d'une ligne colorée

dis_bars, // Affichage de barres colorées

dis_both // Affiche à la fois les lignes et les barres colorées

} ;

extern int CCIperiod = 3 ; // Période CCI

extern int ATRperiod = 300 ; // Période ATR

extern ENUM_APPLIED_PRICE applied_price = PRICE_TYPICAL ; // Prix à utiliser

extern enDisplay DisplayType = dis_line ; // Type d'affichage

extern bool alertsOn = true ; // Activation des alertes

extern bool alertsOnCurrent = false ; // Alertes sur la barre actuelle (encore ouverte)

extern bool alertsMessage = true ; // Les alertes doivent afficher un message pop-up

extern bool alertsSound = true ; // Les alertes doivent jouer un son

extern bool alertsNotify = true ; // Les alertes doivent envoyer une notification

extern bool alertsEmail = false ; // Les alertes doivent envoyer un courrier électronique.

extern string soundFile = "o.wma" ; // Fichier son à utiliser pour les alertes sonores

double TrLine[] ;

double TrendDowna[] ;

double TrendDownb[] ;

double HistUp[] ;

double HistDn[] ;

double trend[] ;

//------------------------------------------------------------------

//

//------------------------------------------------------------------

//

//

//

//

//

int init()

{

IndicatorBuffers(6) ;

int styleLine = DRAW_LINE ; if (DisplayType==dis_bars) styleLine=DRAW_NONE ;

int styleBars = DRAW_HISTOGRAM ; if (DisplayType==dis_line) styleBars=DRAW_NONE ;

SetIndexBuffer(0, HistUp) ; SetIndexStyle(0,styleBars) ;

SetIndexBuffer(1, HistDn) ; SetIndexStyle(1,styleBars) ;

SetIndexBuffer(2, TrLine) ; SetIndexStyle(2,styleLine) ;

SetIndexBuffer(3, TrendDowna) ; SetIndexStyle(3,styleLine) ;

SetIndexBuffer(4, TrendDownb) ; SetIndexStyle(4,styleLine) ;

SetIndexBuffer(5, trend) ;

return(0) ;

}

int deinit(){ return(0) ; }

//------------------------------------------------------------------

//

//------------------------------------------------------------------

//

//

//

//

//

int start()

{

int counted_bars=IndicatorCounted() ;

if(counted_bars<0) return(-1) ;

if(counted_bars>0) counted_bars-- ;

int limit = MathMin(Bars-counted_bars,Bars-1) ;

//

//

//

//

//

si (trend[limit]==-1) CleanPoint(limit,TrendDowna,TrendDownb) ;

for(int i=limite ; i >= 0 ; i--)

{

double cciTrendNow = iCCI(NULL, 0, CCIperiod, applied_price, i) ;

si (cciTrendNow >= 0)

{

TrLine = NormalizeDouble(Low - iATR(NULL, 0, ATRperiod, i),Digits) ;

si (i<(Bars-1) && TrLine < TrLine) TrLine = TrLine ;

}

si (cciTrendNow <= 0)

{

TrLine = NormalizeDouble(High + iATR(NULL, 0, ATRperiod, i),Digits) ;

if (i TrLine) TrLine = TrLine ;

}

//

//

//

//

//

TrendDowna = EMPTY_VALUE ;

TrendDownb = EMPTY_VALUE ;

si (i<(Bars-1))

{

trend = trend ;

si (TrLine> TrLine) trend = 1 ;

si (TrLine< TrLine) trend =-1 ;

si (trend == -1) PlotPoint(i,TrendDowna,TrendDownb,TrLine) ;

si (trend == 1) { HistUp = High ; HistDn = Low ; }

si (trend == -1) { HistDn = High ; HistUp = Low ; }

}

}

manageAlerts() ;

return(0) ;

}

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

//|

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

//

//

//

//

//

void manageAlerts()

{

if (alertsOn)

{

int whichBar = 1 ; if (alertsOnCurrent) whichBar = 0 ;

if (trend[whichBar] != trend[whichBar+1])

{

si (trend[whichBar] == 1) doAlert(whichBar, "up") ;

si (trend[whichBar] ==-1) doAlert(whichBar, "down") ;

}

}

}

//

//

//

//

//

void doAlert(int forBar, string doWhat)

{

static string previousAlert="rien" ;

static datetime previousTime ;

message de type chaîne de caractères ;

if (previousAlert != doWhat || previousTime != Time[forBar]) {

previousAlert = doWhat ;

previousTime = Time[forBar] ;

//

//

//

//

//

message = Symbol()+" à "+TimeToStr(TimeLocal(),TIME_SECONDS)+" SP MA tendance a changé en "+doWhat ;

if (alertsMessage) Alert(message) ;

if (alertsNotify) SendNotification(message) ;

if (alertsEmail) SendMail(Symbol()+" S P MY",message) ;

if (alertsSound) PlaySound(soundFile) ;

}

}

//-------------------------------------------------------------------

//

//-------------------------------------------------------------------

//

//

//

//

//

void CleanPoint(int i,double& first[],double& second[])

{

if (i>=Bars-3) return ;

si ((second != EMPTY_VALUE) && (second != EMPTY_VALUE))

second = EMPTY_VALUE ;

sinon

if ((first != EMPTY_VALUE) && (first != EMPTY_VALUE) && (first == EMPTY_VALUE))

first = EMPTY_VALUE ;

}

void PlotPoint(int i,double& first[],double& second[],double& from[])

{

si (i>=Bars-2) retour ;

si (first == EMPTY_VALUE)

if (first == EMPTY_VALUE)

{ first = from ; first = from ; second = EMPTY_VALUE ; }

else { second = from ; second = from ; first = EMPTY_VALUE ; }

else { first = from ; second = EMPTY_VALUE ; } }

}

s_p_mony__alerts_1.01.mq4

Avez-vous déjà essayé d'utiliser l'appel iCustom() de l'EA ?

Tout ce que vous avez à faire est d'appeler l'indicateur en utilisant la fonction iCustom(), lire le tampon de tendance (tampon 5 dans la nomination metatrader) et quand il change de valeur de -1 à +1 ou de +1 à -1 vous avez un signal.

 

monsieur monsieur s'il vous plaît je suis désolé monsieur ......... je ne sais pas ce qu'est l'appel iCustom()... et où je peux l'essayer ? ?? ...... où je l'ai trouvé dans mt4 ou quand je modifie l'indicateur, dites-moi simplement comment je peux utiliser cet indicateur S P mony dans un tradin automatique / robo trading c'est tout monsieur ..................

si c'est tout un processus long alors s'il vous plaît excusez-moi et s'il vous plaît oubliez les messages ci-dessus merci monsieur

Raison: