int open(int ty,double lott,double prc,int pof,int sll) { double sl=0,tp=0; bool modi; if(lott >Max_Lots)lott=Max_Lots;else lott=lott; if(ty==OP_BUY || ty==OP_BUYSTOP || ty==OP_BUYLIMIT) { if(sll>0){sl=prc-(sll*pt);}else{sl=0;} if(pof>0){tp=prc+(pof*pt);}else{tp=0;} clr=Green; T="Ask "; pr=NormalizeDouble(Ask,Digits); } if(ty==OP_SELL || ty==OP_SELLSTOP || ty==OP_SELLLIMIT) { if(sll>0){sl=prc+(sll*pt);}else{sl=0;} if(pof>0){tp=prc-(pof*pt);}else{tp=0;} clr=Red; T="Bid"; pr=NormalizeDouble(Bid,Digits); } int tik=OrderSend(Symbol() ,ty ,lott ,NormalizeDouble(prc,Digits) ,10 ,0 ,0 ,"samir" ,MagicNumber ,0 ,clr); string t; if(ty==OP_BUY)t="BUY";if(ty==OP_SELL)t="SELL";if(ty==OP_BUYSTOP)t="BUY STOP";if(ty==OP_SELLSTOP)t="SELL STOP";if(ty==OP_BUYLIMIT)t="BUY LIMIT";if(ty==OP_SELLLIMIT)t="SELL LIMIT"; if(tik>0) { if(tp>0 || sl>0)modi=OrderModify(tik,prc,NormalizeDouble(sl,Digits),NormalizeDouble(tp,Digits),0,CLR_NONE); else modi=true; if(!modi){Print("Modify Err#= ",GetLastError()," ",Symbol()," ",Period()," Open Price= ",DoubleToStr(prc,Digits)," SL= ",DoubleToStr(sl,Digits)," Tp= ",DoubleToStr(tp,Digits));} Print("Order Opened successfully " ,"Type ",t," LotSize ",lott," Price ",DoubleToStr(prc,Digits)," TP ",DoubleToStr(tp,Digits)," SL ",DoubleToStr(sl,Digits)); } else { Print("OrderSend failed with error #",GetLastError(), " Type ",t," LotSize= ",lott," ",T,"Now= ",DoubleToStr(pr,Digits)," Price= ",DoubleToStr(prc,Digits)," TP= ",DoubleToStr(tp,Digits)," SL= ",DoubleToStr(sl,Digits)," Spread= ",MarketInfo(Symbol(),MODE_SPREAD)); } ////// return(tik); }
المواضيع المتشابهه | ||||
الموضوع | كاتب الموضوع | المنتدى | مشاركات | آخر مشاركة |
ارجو عمل باك تست عالي الجودة للاكسبيرت | صاحب قرار | منتدى المؤشرات و الاكسبرتات | 10 | 11 - 02 - 2018 06:09 PM |
ارجو اضافة التعديل التالي | yaser elsharkawy | منتدى المؤشرات و الاكسبرتات | 6 | 29 - 05 - 2017 01:04 PM |
اضافة خاصية للاكسبيرت | yaser elsharkawy | منتدى المؤشرات و الاكسبرتات | 9 | 12 - 07 - 2016 04:06 PM |
استاذ سمير برجاء اضافة تعديل للاكسبيرت المرفق | mmohy1 | منتدى المؤشرات و الاكسبرتات | 4 | 20 - 02 - 2016 02:58 PM |