 |
 |
|
 |
|
شكرااااااا لك يا أستاذ اسلام على الرد
كان عندي الخطأ
return value of 'OrderSend' should be checked
الحمد لله وجدت الحل
كود:
//+------------------------------------------------------------------+
//| new-Experts.mq4 |
//| Copyright 2015, Hamza Corp. |
//| https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2015, Hamza Corp."
#property link "https://www.mql5.com"
#property version "1.00"
#property strict
extern string s1 = "Fast Mouving";
extern int FMperiod = 5;
extern int FMshift = 0;
extern int FMmethod = 0;
extern int FMapplied = 0;
extern string s2 = "Low Mouving";
extern int LMperiod = 14;
extern int LMshift = 3;
extern int LMmethod = 0;
extern int LMapplied = 0;
extern string s3 = "Money Manage";
extern int TP = 30;
extern int SL = 10;
extern double lot = 0.1;
extern int magic = 12345;
double t;
//+------------------------------------------------------------------+
//| Expert initialization function |
//+------------------------------------------------------------------+
int OnInit()
{
//---
double ticksize = MarketInfo (Symbol(),MODE_TICKSIZE);
if ( ticksize == 0.00001 || 0.001 )
t = ticksize * 10;
else
t = ticksize ;
//---
return(INIT_SUCCEEDED);
}
//+------------------------------------------------------------------+
//| Expert deinitialization function |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
{
//---
}
//+------------------------------------------------------------------+
//| Expert tick function |
//+------------------------------------------------------------------+
void OnTick()
{
double Fnow = iMA(NULL,0,FMperiod,FMshift,FMmethod,FMapplied,1);
double Flast = iMA(NULL,0,FMperiod,FMshift,FMmethod,FMapplied,2);
double Lnow = iMA(NULL,0,LMperiod,LMshift,LMmethod,LMapplied,1);
double Llast = iMA(NULL,0,LMperiod,LMshift,LMmethod,LMapplied,2);
//---
if ( Fnow > Lnow && Flast < Llast )
if (OrdersTotal()==0)
bool m= OrderSend(Symbol(),OP_BUY,lot,Ask,3,Ask-(SL*t),Ask+(TP*t),NULL,magic,0,Blue);
if ( Fnow < Lnow && Flast > Llast )
if (OrdersTotal()==0)
bool n=OrderSend(Symbol(),OP_SELL,lot,Bid,3,Bid+(SL*t),Bid-(TP*t),NULL,magic,0,Red);
}
//+------------------------------------------------------------------+
و شكرا |
|
 |
|
 |
،،،العفو اخى ولكن هذا ليس خطأ ولكن تنبيه او ملاحظة من البرنامج ، الخطأ يكون باللون الاحمر ويمنع عمل الاكسبيرت ولكن الملاحظة لا تمنع عمله،،،
،،،تحياتى،،،