Ah ouai effectivement moi j'ai error 103
C'est bizarre car en H1 sa arche très bien... Je vais regarder sa de plus près
C'est bizarre car en H1 sa arche très bien... Je vais regarder sa de plus près
La garantie Forexagone permet de vous assurer que votre gain ne soit pas perdu. Nous négocions les meilleurs taux avec les brokers agréés par l’AMF.
//+------------------------------------------------------------------+
//| Point Pivot.mq4 |
//| Copyright 2012, MetaQuotes Software Corp. |
//| http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Jumping Jack Flash Corp"
#property link "http://www.metaquotes.net"
extern double ratio = 2 ;
extern double takeprofit_pips = 400;
extern double risk = 1 ;
extern int hour_order = 8 ;
extern int minute_order = 50 ;
extern int magic_num = 0 ;
extern int Slippage = 5;
int start()
{
// Calcul du point pivot du jour
double close_price = iClose(NULL, PERIOD_D1, 1) ;
double low_price = iLow(NULL, PERIOD_D1, 1) ;
double high_price = iHigh(NULL, PERIOD_D1, 1) ;
double pivot = (close_price + low_price + high_price) / 3 ;
// Condition sur le déclanchement de l'ordre
int time_hour = TimeHour(TimeCurrent()) ;
int time_minute = TimeMinute(TimeCurrent()) ;
if (time_hour == hour_order)
if (time_minute == minute_order)
{
if (OrdersTotal() == 0 )
{
int ticket ;
double current_price = iClose(NULL, PERIOD_H1, 0) ;
double lot = ((AccountBalance() * risk * 0.01) / (0.5 * takeprofit_pips * 0.0001)) / 100000 ;
double stoploss = iClose(NULL, PERIOD_H1, 1) - (0.5 * takeprofit_pips * 0.0001) ;
double takeprofit = takeprofit_pips * 0.0001 + iClose(NULL, PERIOD_H1, 0) ;
if (current_price > pivot)
{ ticket = OrderSend(Symbol(), OP_BUY, lot, Ask, NULL, stoploss, takeprofit, "order pivot", magic_num, 0, Green) ;
return(0) ; }
if (current_price < pivot)
{ ticket = OrderSend(Symbol(), OP_SELL, lot, Bid, NULL, stoploss, takeprofit, "order pivot", magic_num, 0, Red) ;
return(0) ; }
}
}
return(0);
}
double stoploss = iClose(NULL, PERIOD_H1, 1) - (0.5 * takeprofit_pips * 0.0001) ;
double takeprofit = takeprofit_pips * 0.0001 + iClose(NULL, PERIOD_H1, 0) ;
if (current_price > pivot)
{
ticket = OrderSend(Symbol(), OP_BUY, lot, Ask, NULL, stoploss, takeprofit, "order pivot", magic_num, 0, Green) ;
return(0) ;
}
if (current_price < pivot)
{
ticket = OrderSend(Symbol(), OP_SELL, lot, Bid, NULL, stoploss, takeprofit, "order pivot", magic_num, 0, Red) ;
return(0) ;
}
if (current_price > pivot)
{
double stoploss = iClose(NULL, PERIOD_H1, 1) - (0.5 * takeprofit_pips * 0.0001) ;
double takeprofit = takeprofit_pips * 0.0001 + iClose(NULL, PERIOD_H1, 0) ;
ticket = OrderSend(Symbol(), OP_BUY, lot, Ask, NULL, stoploss, takeprofit, "order pivot", magic_num, 0, Green) ;
if(ticket==-1) Print("Erreur à l\'achat");
return(0) ;
}
if (current_price < pivot)
{
stoploss = iClose(NULL, PERIOD_H1, 1) + (0.5 * takeprofit_pips * 0.0001) ;
takeprofit = iClose(NULL, PERIOD_H1, 0) - takeprofit_pips * 0.0001 ;
ticket = OrderSend(Symbol(), OP_SELL, lot, Bid, NULL, stoploss, takeprofit, "order pivot", magic_num, 0, Red) ;
if(ticket==-1) Print("Erreur à la vente");
return(0) ;
}