2 مرفق
اتمنى من الخبراء تصحيح TrailingStop في اكسبيرتي .
السلام عليكم ورحمة الله وبركاته
أنا عارف من يوم ماسجلت في المنتدى وانا مغلبكم بطلباتي الكثير :012: سامحونا أنا عملت اكسبيرت بمساعدة بعض الاخوان الله يجزاهم الف خير واضفت كود TrailingStop بس للاسف في خطا ماعرف وش هو راح ارفق الاكسبيرت في الرفقات الفزعة ياخوان .
كود PHP:
//+------------------------------------------------------------------+
//| |
//| |
//| www.arabictrader.com/vb |
//| |
//| |
//+------------------------------------------------------------------+
#property copyright ""
#property link ""
extern int MaxTrades = 1;
extern double Lots = 1;
extern int StopLoss=30;
extern int TakeProfit=30;
extern double TrailingStop =10;
extern int MagicNumber=2533;
datetime Time0;
double point;
int digits,Q;
int init()
{
if(Digits==5||Digits==3)Q=10;
else Q=1;
if(Digits<4){point=0.01;digits=2;}
else{point=0.0001;digits=4;}
return(0);
}
//+------------------------------------------------------------------+
//| FUNCTION DEFINITIONS deinitialization function |
//+------------------------------------------------------------------+
void deinit() {
Comment("");
}
int orderscnt(){
int cnt=0;
for(int i =0;i<OrdersTotal();i++){
if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)){
if(OrderSymbol()==Symbol() && MagicNumber==OrderMagicNumber()){
cnt++;
}
}
}
return(cnt);
}
//+------------------------------------------------------------------+
//| FUNCTION DEFINITIONS Start function |
//+------------------------------------------------------------------+
int start()
{
//////////////////////////////////////////////////
bool buy,sell;
for(int i=1;i<Bars;i++){
double S1=iCustom(Symbol(),0,"BD Crossover BDv8_12_31",3,50,20,100,false,3,i);
double B1=iCustom(Symbol(),0,"BD Crossover BDv8_12_31",3,50,20,100,false,2,i);
if(S1<5000){sell=true;break;}
if(B1<5000){buy=true;break;}
}
double B=iCustom(NULL,0,"BD Crossover BDv8_12_31",3,50,20,100,false,0,1);
double S=iCustom(NULL,0,"BD Crossover BDv8_12_31",3,50,20,100,false,1,1);
Comment(B);
Comment(S);
////////////////////////////////////////////////////
double SL,TP;
if (buy&&B<5000&&Time0!=Time[0]){
if(orderscnt()<MaxTrades){
if(StopLoss==0){SL=0;}else{SL=Ask-StopLoss*point;}
if(TakeProfit==0){TP=0;}else{TP=Ask+TakeProfit*point;}
OrderSend(Symbol(),OP_BUY,Lots,NormalizeDouble(Ask,Digits),3*Q,SL,TP,"EA",MagicNumber,0,Blue);
PlaySound("Alert.wav");
Time0=Time[0];
}
}
/////////////////////
if (sell&&S<5000&&Time0!=Time[0]){
if(orderscnt()<MaxTrades){
if(StopLoss==0){SL=0;}else{SL=Bid+StopLoss*point;}
if(TakeProfit==0){TP=0;}else{TP=Bid-TakeProfit*point;}
OrderSend(Symbol(),OP_SELL,Lots,NormalizeDouble(Bid,Digits),3*Q,SL,TP,"EA",MagicNumber,0,Red);
PlaySound("Alert.wav");
Time0=Time[0];
}
}
//+------------------------------------------------------------------+
//| FUNCTION DEFINITIONS TrailingStop |
//+------------------------------------------------------------------+
if(TrailingStop>0)
{
if((OrderOpenPrice()-Ask)>(Point*TrailingStop))
{
if((OrderStopLoss()>(Ask+Point*TrailingStop)) || (OrderStopLoss()==0))
{
OrderModify(OrderTicket(),OrderOpenPrice(),Ask+Point*TrailingStop,
OrderTakeProfit(),0,Red);
return(0);
}
}
}
return(0);
if(TrailingStop>0)
{
if(Bid-OrderOpenPrice()>Point*TrailingStop)
{
if(OrderStopLoss()<Bid-Point*TrailingStop)
{
OrderModify(OrderTicket(),OrderOpenPrice(),Bid-Point*TrailingStop,
OrderTakeProfit(),0,Green);
return(0);
}
}
}
}
//+---------------------------------------------------------------------------------+
1 مرفق
رد:اتمنى من الخبراء تصحيح TrailingStop في اكسبيرتي .
1 مرفق
رد:اتمنى من الخبراء تصحيح TrailingStop في اكسبيرتي .
السلام عليكم ورحمة الله وبركاته
أخي الكريم دوال
OrderOpenPrice()
orderstoploss()
ordertakeprofite()
وكل ما يبدأ ب Order......etc
لا بد من أن تسبقه دالة orderselect
راجع التعديل المرفق " لم أجرب الاكسبرت"
راعي موضوع 4 نقاط و5 نقاط في المنصة
1 مرفق
رد:اتمنى من الخبراء تصحيح TrailingStop في اكسبيرتي .
تفضل اخي اضفت كل ما تحتاج فى الاكسبرت ومعه الشرح داخل الاكسبرت اتمنى يفيدك فى تعلمك للبرمجه حسب علمي هدفك تتعلم
الاضافت توقيت عمل اليومي واغلاق فى حال عكس الاشاره للمؤشرين ملاحة ربح وبريك افين ونسبة دخول مئويه من الحساب بالتوفيق
رد:اتمنى من الخبراء تصحيح TrailingStop في اكسبيرتي .
اخوي uae forex
ممكن تشرحلي الفرق بين BreakEven و movestopto وTrailingStop في خصائص الاكسبيرت