Determinacao do + alto e +baixo num determinado periodo

 

Boa Tarde... Nova na programmacao... 

Meus primeiros passos se fazem com o livro: PROGRAMMER EN MQL4 Apprenez à automatiser vos stratégies sur MetaTrader 4..

Ate aqui tudo bem, so que os programmas defenidos neste nao fonctionnant.. no entanto interessantes.

 

Aqui vai... determinar o + alto e +baixo n'um determinado tempo. Quais sap as fonction a usar e os seus parametros?!!

 

programmacao do livro: (com pequenas alteraçoes)

  • ... 
  •  extern int iHeureDebut=8;
  •  extern int iMinuteDebut=1;
  •  extern int iHeureFin=8;
  •  extern int iMinuteFin=59;
  •  
  •  int iTimeDebut;
  •  int iTimeFin;
  • int iTimeSeconde;

  • double dPlusHaut, dPlusBas;

  • int iDate;
  • bool bRecuperation = False;


  • string debutMessage="la valeurs la plus haut est ";
  • string finMessage="la valeur la plus bas est ";
  • //+------------------------------------------------------------------+
  • //| Expert initialization function                                   |
  • //+------------------------------------------------------------------+
  • int init()
  •   {
  •  
  •    iTimeDebut= iHeureDebut*3600+iMinuteDebut*60;
  •    iTimeFin= iHeureFin*3600+iMinuteFin*60;
  •   

  •    return(INIT_SUCCEEDED);
  •   }
  • //+------------------------------------------------------------------+
  • //| Expert deinitialization function                                 |
  • //+------------------------------------------------------------------+
  • int deinit()
  •   {
  •  return(INIT_SUCCEEDED);
  •   }
  • //+------------------------------------------------------------------+
  • //| Expert start function                                             |
  • //+------------------------------------------------------------------+
  • int start()
  •   {
  •    iTimeSeconde= Hour()*3600+ Minute()*60+ Seconds();
  •    
  •    if(iTimeSeconde=iTimeDebut && iTimeSeconde<=iTimeFin)
  •      {
  •      if(bRecuperation==False)
  •        {
  •        iDate=Day();  
  •        dPlusHaut = iHigh(Symbol(),PERIOD_D1,0);
  •        dPlusBas = iLow(Symbol(),PERIOD_D1,0);
  •    
  •     bRecuperation=True;
  •     Print(debutMessage,dPlusHaut, finMessage, dPlusBas);
  •    
  •     }
  •    
  •    if(iDate!=Day())
  •    bRecuperation = False;
  •     }
  •    
  •  return(INIT_SUCCEEDED);
  •    
  •   }
  • //+------------------------------------------------------------------+

e o meu... que me da os valores do dia e nao na hora pedida. 

 

extern int iHeureDebut=8;

extern int iMinutesDebut=0;

extern int iHeureFin=8;

extern int iMinutesFin=59;


int iDate;

int iTimeDebut;

int iTimeFin;

int iTimeSeconds;

double dPlusHaut;

double dPlusBas;

bool bRecuperation = False;


string debutMessage = "la valeur la plus haute est";

string finMessage = "et la valeur la bas haute est";

string debutMessage2 = "iTime debut est";

string FinMessage2 = "iTime fin est";

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

//| Expert initialization function                                   |

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

int init()

  {

  iTimeDebut=iHeureDebut*3600 + iMinutesDebut*60;

  iTimeFin=iHeureFin*3600 + iMinutesFin*60;

  

  Print(debutMessage2,iTimeDebut,FinMessage2,iTimeFin);

  

   return(INIT_SUCCEEDED);

  }

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

//| Expert deinitialization function                                 |

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

int deinit()

  {

    

   


 return(INIT_SUCCEEDED);

  }

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

//| Expert start fonction                                             |

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

int start()

  {

  

  

  iTimeSeconds = Hour()*3600 + Minute()*60 + Seconds();

  

  for(iTimeSeconds = iTimeDebut;iTimeSeconds <= iTimeFin;iTimeSeconds++ )

  {

if(bRecuperation==False)

    {

    iDate = Day();

    dPlusHaut = iHigh(NULL,PERIOD_D1,0);

    dPlusBas = iLow(NULL,PERIOD_D1,0);

   

    bRecuperation=True;

    Print(debutMessage,dPlusHaut, finMessage, dPlusBas);

  

  

    }

if(iDate!=Day())

bRecuperation = False;

    

 }

    return(INIT_SUCCEEDED);

   

  }

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

 

Obrigada 

 

 


 
//+--------------------------------------------------------+
//|                  e-Smart_Tralling  LB-X1                  |
//+--------------------------------------------------------+

extern   bool     UseOneAccount = true;
extern   bool     UseCloseOneThird = true;
extern   int      LevelProfit1 = 10;
extern   int      LevelMoving1 = 1;
extern   int      LevelProfit2 = 20;
extern   int      LevelMoving2 = 2;
extern   int      LevelProfit3 = 30;
extern   int      LevelMoving3 = 3;
extern   int      TrailingStop = 60;
extern   int      TrailingStep = 5;
extern   int      Slippage = 2;
extern   bool     ShowComment = true;
extern   bool     UseSound = true;

string   var_132 = "expert.wav";


qual seria a função do "Slippage"  ??

Razão: