بارك لله فيك اخي هد هو الكواد وان شاء لله يكون صحيح [PHP]extern int StopLoss=0; extern int TakeProfit=0; extern double Lot=0.1; extern int MagicNumber=14000; //+------------------------------------------------------------------+ //| expert initialization function | //+------------------------------------------------------------------+ int init() { //---- Open price //---- return(0); } //+------------------------------------------------------------------+ //| expert deinitialization function | //+------------------------------------------------------------------+ int deinit() { //---- return(0); } //+------------------------------------------------------------------+ //| expert start function | //+------------------------------------------------------------------+ int start() { { double SL,TP; double MACD=iMACD("EURUSD",PERIOD_M15,12,26,9,MODE_CLOSE, MODE_MAIN,0); double MACD1=iMACD("EURUSD",PERIOD_M15,12,26,9,MODE_CLOSE ,MODE_MAIN,1); if(MACD<0&&MACD1>0){ if(StopLoss==0){SL=0;}else{SL=Ask-StopLoss*Point;} if(TakeProfit==0){TP=0;}else{TP=Ask+TakeProfit*Poi nt;} OrderSend(Symbol(),OP_BUY,Lot,Ask,33,SL,TP,"AYOOB" ,MagicNumber,0,Green); } if(MACD>0&&MACD1<0){ if(StopLoss==0)SL=0;}else{SL=Bid+StopLoss*Point;} if(TakeProfit==0){TP=0;}else{TP=Bid-TakeProfit*Point;} OrderSend(Symbol(),OP_SELL,Lot,Bid,33,SL,TP,"AYOOB ",MagicNumber,0,Red); } } //---- return(0); [/PHP] |
|||
ارجع الي مشاركتي السابقة ستجد الحل
2- دقق في شروط فتح الصفقة اضن انك عكستها