Aide au codage - page 320

 

Bonjour,

Cela fait longtemps que je ne suis pas venu ici...

Je travaille sur une idée d'EA, j'ai besoin d'ajouter un indicateur mais je ne sais pas comment l'inclure dans l'EA, pouvez-vous m'aider s'il vous plaît ?

L'indicateur est Slope Directional Line, je veux qu'il fonctionne dans le graphique quotidien et qu'il déclenche des ordres dans le graphique TF inférieur, le code de l'indicateur est :

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

//| pente ligne directionnelle D.L.M.mq4

//| DANIEL LUCHINGER 2014 |

//| MQL5 : trading forex automatisé, testeur de stratégie et indicateurs personnalisés avec MetaTrader |

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

#property indicator_chart_window

#property indicator_buffers 2

#property indicator_color1 Blue

#property indicator_width1 3

#property indicator_color2 Red

#property indicator_width2 3

//---- paramètres d'entrée

extern int period=14 ;

extern int method=3 ; // MODE_SMA

extern int price=0 ; // PRICE_CLOSE

//---- tampons

double Uptrend[] ;

double Dntrend[] ;

double ExtMapBuffer[] ;

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

//| Fonction d'initialisation de l'indicateur personnalisé

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

int init()

{

IndicatorBuffers(3) ;

SetIndexBuffer(0, Uptrend) ;

SetIndexBuffer(1, Dntrend) ;

SetIndexBuffer(2, ExtMapBuffer) ;

ArraySetAsSeries(ExtMapBuffer, true) ;

SetIndexStyle(0,DRAW_LINE,STYLE_SOLID,3) ;

SetIndexStyle(1,DRAW_LINE,STYLE_SOLID,3) ;

IndicatorShortName("Ligne de direction de la pente") ;

return(0) ;

}

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

//| Fonction personnalisée de désinitialisation de l'indicateur |

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

int deinit(){return(0);}

double WMA(int x, int p)

{

return(iMA(NULL, 0, p, 0, méthode, prix, x)) ;

}

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

//| Fonction d'itération d'indicateur personnalisée |

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

int start()

{

int counted_bars = IndicatorCounted() ;

if(counted_bars < 0)

retour(-1) ;

int x = 0 ;

int p = MathSqrt(period) ;

int e = Bars - counted_bars + period + 1 ;

double vect[], trend[] ;

if(e > Bars)

e = Bars ;

ArrayResize(vect, e) ;

ArraySetAsSeries(vect, true) ;

ArrayResize(trend, e) ;

ArraySetAsSeries(trend, true) ;

for(x = 0 ; x < e ; x++)

{

vect[x] = 2*WMA(x, period/2) - WMA(x, period) ;

}

for(x = 0 ; x < e-période ; x++)

ExtMapBuffer[x] = iMAOnArray(vect, 0, p, 0, method, x) ;

for(x = e-période ; x >= 0 ; x--)

{

trend[x] = trend[x+1] ;

si (ExtMapBuffer[x]> ExtMapBuffer[x+1]) trend[x] =1 ;

si (ExtMapBuffer[x]< ExtMapBuffer[x+1]) trend[x] =-1 ;

si (trend[x]>0)

{ Uptrend[x] = ExtMapBuffer[x] ;

si (trend[x+1]<0) Uptrend[x+1]=ExtMapBuffer[x+1] ;

Dntrend[x] = EMPTY_VALUE ;

}

sinon

si (trend[x]<0)

{

Dntrend[x] = ExtMapBuffer[x] ;

if (trend[x+1]>0) Dntrend[x+1]=ExtMapBuffer[x+1] ;

Uptrend[x] = EMPTY_VALUE ;

}

}

return(0) ;

---------------

--------------

J'ai codé de la façon suivante :

double UpTrend = iCustom(NULL,1440, "pente ligne directionnelle D.L.M",20,3,0,1) ; // où 0 = UptrendBuffer

double DnTrend = iCustom(NULL,1440, "pente ligne directionnelle D.L.M",20,3,1,1) ; // où 1 = DntrendBuffer

double _sl = 0,_tp = 0 ;

{

if(haMode == 0 || haMode == 1)

{

if(UpTrend)

{label("Condition LONGUE OK") ;

if(Close[0] >= srDown && Close[0] < srUp)

//if(StopLoss > 0) _sl = Ask - StopLoss ;

_sl = srDownHT-StopLossShift ;

if(TakeProfit > 0) _tp = Ask + TakeProfit ;

if(tt && orders<MaxTrades)

{

openOrder(getLots(),MagicNumber,OP_BUY, _sl,_tp) ;

}

}}

}

}

Quelqu'un peut-il me corriger, car je suis sûr que cela ne fonctionne pas ?

Merci

Daniel1983

 

Merci beaucoup Mistertools pour votre aide.

Mais ...

Ce que je veux faire, c'est appliquer une moyenne mobile à la #_FullSSA_normalize correct mtf nmc.

Cela fonctionne sans problème lorsque je le fais sur le M5 de manière normale avec l'aide de la MA de MT4.

C'est la seule chose que j'utilise de MT4 ...

Sur le M1, cela fonctionne parfois, d'autres fois non. Cela pourrait avoir un rapport avec les paramètres.

Regardez l'image, le SSA est correct, mais pas la MA ...

J'ai essayé de le faire moi-même, mais c'est beaucoup trop compliqué pour moi, bien que je n'ai eu que deux erreurs, après "mon travail" ....

J'ai dû avoir de la chance, mais néanmoins, le SSA a fonctionné sans problème, mais la MA n'était nulle part.

Bien sûr, le SSA est un modèle d'élite .....

que j'ai acheté il y a quelques temps et qui vaut le coup ...

Dossiers :
ssa.png  72 kb
 
daniel1983:
Bonjour,

Cela fait longtemps que je ne suis pas venu ici...

Je travaille sur une idée d'EA, j'ai besoin d'ajouter un indicateur mais je ne sais pas comment l'inclure dans l'EA, pouvez-vous m'aider s'il vous plaît ?

L'indicateur est Slope Directional Line, je veux qu'il fonctionne dans le graphique quotidien et qu'il déclenche des ordres dans le graphique TF inférieur, le code de l'indicateur est :

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

//| pente ligne directionnelle D.L.M.mq4

//| DANIEL LUCHINGER 2014 |

//| MQL5 : trading forex automatisé, testeur de stratégie et indicateurs personnalisés avec MetaTrader |

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

#property indicator_chart_window

#property indicator_buffers 2

#property indicator_color1 Blue

#property indicator_width1 3

#property indicator_color2 Red

#property indicator_width2 3

//---- paramètres d'entrée

extern int period=14 ;

extern int method=3 ; // MODE_SMA

extern int price=0 ; // PRICE_CLOSE

//---- tampons

double Uptrend[] ;

double Dntrend[] ;

double ExtMapBuffer[] ;

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

//| Fonction d'initialisation de l'indicateur personnalisé

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

int init()

{

IndicatorBuffers(3) ;

SetIndexBuffer(0, Uptrend) ;

SetIndexBuffer(1, Dntrend) ;

SetIndexBuffer(2, ExtMapBuffer) ;

ArraySetAsSeries(ExtMapBuffer, true) ;

SetIndexStyle(0,DRAW_LINE,STYLE_SOLID,3) ;

SetIndexStyle(1,DRAW_LINE,STYLE_SOLID,3) ;

IndicatorShortName("Ligne de direction de la pente") ;

return(0) ;

}

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

//| Fonction personnalisée de désinitialisation de l'indicateur |

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

int deinit(){return(0);}

double WMA(int x, int p)

{

return(iMA(NULL, 0, p, 0, méthode, prix, x)) ;

}

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

//| Fonction d'itération d'indicateur personnalisée |

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

int start()

{

int counted_bars = IndicatorCounted() ;

if(counted_bars < 0)

retour(-1) ;

int x = 0 ;

int p = MathSqrt(period) ;

int e = Bars - counted_bars + period + 1 ;

double vect[], trend[] ;

if(e > Bars)

e = Bars ;

ArrayResize(vect, e) ;

ArraySetAsSeries(vect, true) ;

ArrayResize(trend, e) ;

ArraySetAsSeries(trend, true) ;

for(x = 0 ; x < e ; x++)

{

vect[x] = 2*WMA(x, period/2) - WMA(x, period) ;

}

for(x = 0 ; x < e-période ; x++)

ExtMapBuffer[x] = iMAOnArray(vect, 0, p, 0, method, x) ;

for(x = e-période ; x >= 0 ; x--)

{

trend[x] = trend[x+1] ;

si (ExtMapBuffer[x]> ExtMapBuffer[x+1]) trend[x] =1 ;

si (ExtMapBuffer[x]< ExtMapBuffer[x+1]) trend[x] =-1 ;

si (trend[x]>0)

{ Uptrend[x] = ExtMapBuffer[x] ;

si (trend[x+1]<0) Uptrend[x+1]=ExtMapBuffer[x+1] ;

Dntrend[x] = EMPTY_VALUE ;

}

sinon

si (trend[x]<0)

{

Dntrend[x] = ExtMapBuffer[x] ;

if (trend[x+1]>0) Dntrend[x+1]=ExtMapBuffer[x+1] ;

Uptrend[x] = EMPTY_VALUE ;

}

}

return(0) ;

---------------

--------------

J'ai codé de la façon suivante :

double UpTrend = iCustom(NULL,1440, "pente ligne directionnelle D.L.M",20,3,0,1) ; // où 0 = UptrendBuffer

double DnTrend = iCustom(NULL,1440, "pente ligne directionnelle D.L.M",20,3,1,1) ; // où 1 = DntrendBuffer

double _sl = 0,_tp = 0 ;

{

if(haMode == 0 || haMode == 1)

{

if(UpTrend)

{label("Condition LONGUE OK") ;

if(Close[0] >= srDown && Close[0] < srUp)

//if(StopLoss > 0) _sl = Ask - StopLoss ;

_sl = srDownHT-StopLossShift ;

if(TakeProfit > 0) _tp = Ask + TakeProfit ;

if(tt && orders<MaxTrades)

{

openOrder(getLots(),MagicNumber,OP_BUY, _sl,_tp) ;

}

}}

}

}

Quelqu'un peut-il me corriger, car je suis sûr que cela ne fonctionne pas ?

Merci

Daniel1983

Cela ne fonctionne pas, tout simplement parce que la ligne directionnelle de pente est un indicateur de repeuplement. Prenez une moyenne de Hull normale ("slope directional line" est une moyenne de Hull) et tout sera plus simple.

 

Merci Mladen, j'apprécie le temps que vous m'avez consacré.

J'ai trouvé à travers les posts sur le HMA, un que vous avez créé avec un contrôle de vitesse,

je voudrais l'essayer dans l'EA, la même idée que je voulais avec l'indicateur directionnel de pente,

mais avec l'indicateur HMA que vous avez posté "Hull Moving Averages 2.0 &SR lines".

comment serait le code pour que cela fonctionne dans mon EA ?

J'ai écrit :

input int IndicatorTF = 1440 //(indicateur dans le TimeFrame quotidien)

input int HMAPeriod = 35 ; //(me permet de changer ces paramètres)

input ENUM_HMAPrice = PRICE_CLOSE ; //(permettez-moi de modifier ces paramètres)

input int HMASpeed = 2.0 ; //(permettez-moi de modifier ces paramètres)

double trendUp = iCustom(Symbol(),IndicatorTF, "Hull moving average 2.0 & sr lines",HMAPeriod,ENUM_HMAPrice,HMASpeed,0,0) ;

double trendDn = iCustom(Symbol(),IndicatorTF, "Hull moving average 2.0 & sr lines",HMAPeriod,ENUM_HMAPrice,HMASpeed,1,0) ;

if(trendUp > 0)

{

Ouvrir Acheter

}

Le code de l'indicateur est :

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

//| Moyenne mobile de la coque |

//| mladen |

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

#property copyright"www.forex-tsd.com"

#property link "www.forex-tsd.com"

#property indicator_chart_window

#property indicator_buffers 3

#property indicator_color1 LimeGreen

#property indicateur_color2 PaleVioletRed

#property indicator_color3 PaleVioletRed

#property indicator_width1 2

#property indicator_width2 2

#property indicator_width3 2

//

//

//

//

//

extern string TimeFrame = "Cadre temporel actuel" ;

extern int HMAPeriod = 35 ;

extern int HMAPrice = PRICE_CLOSE ;

extern double HMASpeed = 2.0 ;

extern bool LinesVisible = false ;

extern int LinesNumber = 5 ;

extern color ColorUp = LimeGreen ;

extern color ColorDown = PaleVioletRed ;

extern string UniqueID = "HullLines1" ;

extern bool alertsOn = false ;

extern bool alertsOnCurrent = true ;

extern bool alertsMessage = true ;

extern bool alertsSound = false ;

extern bool alertsEmail = false ;

//

//

//

//

//

double hma[] ;

double hmada[] ;

double hmadb[] ;

double work[] ;

double trend[] ;

int HalfPeriod ;

int HullPeriod ;

string indicatorFileName ;

bool returnBars ;

bool calculateValue ;

int timeFrame ;

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

//

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

//

//

//

//

//

int init()

{

IndicatorBuffers(5) ;

SetIndexBuffer(0,hma) ;

SetIndexBuffer(1,hmada) ;

SetIndexBuffer(2,hmadb) ;

SetIndexBuffer(3,trend) ;

SetIndexBuffer(4,work) ;

//

//

//

//

//

HMAPeriod = MathMax(2,HMAPeriod) ;

HalfPeriod = MathFloor(HMAPeriod/HMASpeed) ;

HullPeriod = MathFloor(MathSqrt(HMAPeriod)) ;

indicatorFileName = WindowExpertName() ;

calculateValue = TimeFrame== "calculateValue" ; if (calculateValue) { return(0) ; }

returnBars = TimeFrame== "returnBars" ; if (returnBars) { return(0) ; }

timeFrame = stringToTimeFrame(TimeFrame) ;

//

//

//

//

//

IndicatorShortName(timeFrameToString(timeFrame)+" HMA ("+HMAPeriod+")") ;

return(0) ;

}

void deinit()

{

deleteLines() ;

}

void deleteLines()

{

int lookForLength = StringLen(UniqueID) ;

for (int i= ObjectsTotal()-1 ; i>=0 ; i--)

{

string name = ObjectName(i) ;

si (StringSubstr(name,0,lookForLength)==UniqueID) ObjectDelete(name) ;

}

}

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

//

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

//

//

//

//

//

int start()

{

int i,counted_bars = IndicatorCounted() ;

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

if(counted_bars>0) counted_bars-- ;

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

if (returnBars) { hma[0] = MathMin(limit+1,Bars-1) ; return(0) ; }

//

//

//

//

//

if (calculateValue || timeFrame == Period())

{

if (trend[limit] == -1) CleanPoint(limit,hmada,hmadb) ;

for(i=limit ; i>=0 ; i--) work = 2.0*iMA(NULL,0,HalfPeriod,0,MODE_LWMA,HMAPrice,i)-iMA(NULL,0,HMAPeriod,0,MODE_LWMA,HMAPrice,i) ;

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

{

hma = iMAOnArray(work,0,HullPeriod,0,MODE_LWMA,i) ;

hmada = EMPTY_VALUE ;

hmadb = EMPTY_VALUE ;

trend = trend ;

si (hma > hma) trend = 1 ;

si (hma < hma) trend = -1 ;

si (trend == -1) PlotPoint(i,hmada,hmadb,hma) ;

}

deleteLines() ;

if (LinesVisible)

{

int k = 0 ;

for (i=0 ; i<Bars && k<LinesNumber ; i++)

si (trend!=trend)

{

string name = UniqueID+(string)Time ;

ObjectCreate(name,OBJ_TREND,0,Time,hma,Time+Period()*60,hma) ;

si (trend==1)

ObjectSet(name,OBJPROP_COLOR,ColorUp) ;

sinon ObjectSet(name,OBJPROP_COLOR,ColorDown) ;

k++ ;

}

}

manageAlerts() ;

retour(0) ;

}

//

//

//

//

//

limit = MathMax(limit,MathMin(Bars-1,iCustom(NULL,timeFrame,indicatorFileName, "returnBars",0,0)*timeFrame/Period())) ;

si (trend[limit]==-1) CleanPoint(limit,hmada,hmadb) ;

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

{

int y = iBarShift(NULL,timeFrame,Time) ;

trend = iCustom(NULL,timeFrame,indicatorFileName, "calculateValue",HMAPeriod,HMAPrice,HMASpeed,LinesVisible,LinesNumber,ColorUp,ColorDown,UniqueID,alertsOn,alertsOnCurrent,alertsMessage,alertsSound,alertsEmail,3,y) ;

hma = iCustom(NULL,timeFrame,indicatorFileName, "calculateValue",HMAPeriod,HMAPrice,HMASpeed,LinesVisible,LinesNumber,ColorUp,ColorDown,UniqueID,alertsOn,alertsOnCurrent,alertsMessage,alertsSound,alertsEmail,0,y) ;

hmada = EMPTY_VALUE ;

hmadb = EMPTY_VALUE ;

}

for (i=limit;i>=0;i--) if (trend==-1) PlotPoint(i,hmada,hmadb,hma) ;

retour(0) ;

}

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

//|

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

//

//

//

//

//

void manageAlerts()

{

if (alertsOn)

{

si (alertsOnCurrent)

int whichBar = 0 ;

sinon whichBar = 1 ;

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()+" "+timeFrameToString(Period())+" at "+TimeToString(TimeLocal(),TIME_SECONDS)+" La tendance HMA a changé en "+doWhat ;

if (alertsMessage) Alert(message) ;

if (alertsEmail) SendMail(Symbol()+" HMA ",message) ;

if (alertsSound) PlaySound("alert2.wav") ;

}

}

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

//

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

//

//

//

//

//

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

{

if ((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 (first == EMPTY_VALUE)

{

if (first == EMPTY_VALUE) {

first = from ;

first = from ;

second = EMPTY_VALUE ;

}

else {

second = de ;

second = de ;

first = EMPTY_VALUE ;

}

}

else

{

first = from ;

second = EMPTY_VALUE ;

}

}

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

//

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

//

//

//

//

//

string sTfTable[] = {"M1", "M5", "M15", "M30", "H1", "H4", "D1", "W1", "MN"} ;

int iTfTable[] = {1,5,15,30,60,240,1440,10080,43200} ;

//

//

//

//

//

int stringToTimeFrame(string tfs)

{

tfs = stringUpperCase(tfs) ;

for (int i=ArraySize(iTfTable)-1 ; i>=0 ; i--)

if (tfs==sTfTable || tfs==""+iTfTable) return(MathMax(iTfTable,Period())) ;

return(Période()) ;

}

string timeFrameToString(int tf)

{

for (int i=ArraySize(iTfTable)-1 ; i>=0 ; i--)

if (tf==iTfTable) return(sTfTable) ;

return("") ;

}

//

//

//

//

//

string stringUpperCase(string str)

{

string s = str ;

for (int length=StringLen(str)-1 ; length>=0 ; length--)

{

int tchar = StringGetChar(s, length) ;

if((tchar > 96 && tchar 223 && tchar < 256))

s = StringSetChar(s, length, tchar - 32) ;

autre si(tchar > -33 && tchar < 0))

s = StringSetChar(s, length, tchar + 224) ;

}

return(s) ;

}

 
mladen:
Ce n'est pas un problème d'interférence d'autres indicateurs (sauf si vous utilisez plusieurs instances du même indicateur sur le même graphique). Dans ce cas, cela peut arriver puisque cet indicateur n'est pas écrit pour être utilisé comme un indicateur à instances multiples sur le même graphique.

Bonjour MLaden, merci beaucoup mais il ne s'agit pas d'un cas où j'utilise plus d'une instance sur un graphique, mais une seule.

Si ce n'est pas évident, ne vous inquiétez pas, je vais le garder tel quel, merci pour votre contribution ! bonne journée...

zigflip

 
zigflip:
Bonjour MLaden, merci beaucoup mais il ne s'agit pas d'un cas où j'utilise plus d'une instance sur un graphique, mais une seule.

Si ce n'est pas évident, ne vous inquiétez pas, je vais le garder tel quel, merci pour votre contribution ! bonne journée...

zigflip

J'ai essayé celui que j'ai posté et ils n'ont pas bougé.

Essayez-le, peut-être que cela vous aidera

 

Comment appeler un indicateur HMA dans un EA ?

double (NULL,0, "HMA", ??????)

Et les conditions sont

if(trendUp) then buy, ou if(trendUp =1) then buy ou quelque chose comme ça ?

merci

 
daniel1983:
Comment puis-je appeler un indicateur HMA dans un EA ?

double (NULL,0, "HMA", ??????)

Et les conditions sont

if(trendUp) then buy, ou if(trendUp =1) then buy ou quelque chose comme ça ?

Merci

Cela dépend des paramètres des indicateurs, mais vous devez utiliser iCustom() pour cela.

Vous trouverez beaucoup plus d'informations et quelques exemples ici : https://www.mql5.com/en/forum/173108

 
mladen:
Cela dépend des paramètres de l'indicateur, mais vous devez utiliser iCustom() pour cela. Vous trouverez plus d'informations et de nombreux exemples ici : https://www.mql5.com/en/forum/173108

Merci de m'avoir guidé, je suis toujours confus, j'ai trouvé un indicateur HMA dont le code est similaire à celui de la ligne de pente, c'est "HMA_Russian_Color", mais j'ai toujours des problèmes avec les conditions, pour filtrer la tendance d'achat de la tendance de vente.

J'ai écrit

double Uptrend = iCustom(Symbol(),0, "HMA_Russian_Color",20,3,0,0) ; // où le dernier 0 = UptrendBuffer

double Dntrend = iCustom(Symbol(),0, "HMA_Russian_Color",20,3,0,1) ; // où dernier 1 = DntrendBuffer

//period = 20 / type = 3 / price = 0 est correct ?

if(Uptrend) //Comment dois-je écrire ceci ?

{

Ouvrir Acheter

}

Ordres d'achat encore ouvert alors que HMA tendance à la baisse ou de couleur rouge ...

S'il vous plaît, corrigez-moi, et ou aidez-moi à réparer cela...

Merci

 
daniel1983:
Merci de m'avoir guidé, je suis toujours confus, j'ai trouvé un indicateur HMA avec un code similaire à celui de la ligne de pente, c'est "HMA_Russian_Color", mais j'ai toujours des problèmes avec les conditions, pour filtrer la tendance d'achat de la tendance de vente.

i a écrit

double Uptrend = iCustom(Symbol(),0, "HMA_Russian_Color",20,3,0,0) ; // où le dernier 0 = UptrendBuffer

double Dntrend = iCustom(Symbol(),0, "HMA_Russian_Color",20,3,0,1) ; // où dernier 1 = DntrendBuffer

//period = 20 / type = 3 / price = 0 est correct ?

if(Uptrend) //Comment dois-je écrire ceci ?

{

Ouvrir Acheter

}

Ordres d'achat encore ouvert alors que HMA tendance à la baisse ou de couleur rouge ...

S'il vous plaît, corrigez-moi, et ou aidez-moi à réparer cela...

Merci

Pour le changement de pente, essayez quelque chose comme ceci :

double current = iCustom(Symbol(),0,"HMA_Russian_Color",20,3,0,0);

double previous1 = iCustom(Symbol(),0,"HMA_Russian_Color",20,3,0,1);

double previous2 = iCustom(Symbol(),0,"HMA_Russian_Color",20,3,0,2);

if (current>previous1 && previous1<previous2)

{

// slope changed to up

}

if (currentprevious2)

{

// slope changed to down

}