//+------------------------------------------------------------------+
//| FM.mq4 |
//| Nicolas |
//| |
//+------------------------------------------------------------------+
#property copyright "Nicolas"
#property link ""
extern double lots = 0.01;
extern int stop = 270;
extern int limite = 80;
int magic = 52565256;
double TheHaut;
double TheBas;
int heure;
int minute;
int seconde;
int jour;
int mois;
int annee;
//+------------------------------------------------------------------+
//| expert start function |
//+------------------------------------------------------------------+
int start()
{
//----
heure= Hour();
minute = Minute();
seconde = Seconds();
jour = Day();
mois = Month();
annee = Year();
Comment("Heure: "+heure+":"+minute+":"+seconde+" "+"Date: "+jour+"/"+mois+"/"+annee);
//----
int total = OrdersTotal();
//----
TheHaut=High[iHighest(NULL,0,MODE_HIGH,20,1)];
double TheHaut = NormalizeDouble(TheHaut, Digits);
double SL_bs = NormalizeDouble( (TheHaut - stop*Point), Digits);
double TP_bs = NormalizeDouble( (TheHaut + limite*Point), Digits);
//----
TheBas=Low[iLowest(NULL,0,MODE_LOW,20,1)];
double TheBas = NormalizeDouble(TheBas, Digits);
//----
if( total == 0 ) // pour avoir un seul ordre à la fois
{
OrderSend(Symbol(), OP_BUYSTOP, lots, TheHaut, 5, TheHaut - (stop *
Point), TheHaut + (limite * Point), "aaa" ,magic, 0, Blue);
OrderSend(Symbol(), OP_SELLSTOP, lots, TheBas, 5, TheBas + (stop *
Point), TheBas - (limite * Point), "bbb" ,magic, 0, Red);
}
//----
return(0);
}
//----