مستر دولار ممكن مساعدتك ؟
النتائج 1 إلى 2 من 2
  1. #1
    تاريخ التسجيل
    Nov 2010
    الإقامة
    المملكة العربية السعودية
    المشاركات
    203

    افتراضي مستر دولار ممكن مساعدتك ؟

    السلام عليكم ورحمة الله وبركاته

    أعمل على برمجة استراتجية في المرفقات الصورة

    عند تعاكس البارابوليك نستفيد من مؤشر fractals فقط في منطقة التذبذب وفتح صفقة مع الاتجاه الذي كسره السعر

    1-برمجة الاكسبرت ولكن للأسف لا يتبع الاستراتجية فما السبب ؟
    2-ان أمكن أريد !! كود معادلة موفنج أفريج اكسبوننشل للاكسبرت وليس iMA

    شكرا


    كود:
    //+------------------------------------------------------------------+
    //|                                                        تفاؤل.mq4 |
    //|                      Copyright © 2012, MetaQuotes Software Corp. |
    //|                                        http://www.metaquotes.net |
    //+------------------------------------------------------------------+
    #property copyright "Copyright © 2012, MetaQuotes Software Corp."
    #property link      "http://www.metaquotes.net"
    int  sellopend=1;
    int  buyopend=1;
    extern double MP=1;
    extern int range1=0;
    extern int NO=5;
    extern double magic2=131313;
    extern double sar1=0.1;
    extern double sar11=0.01;
    extern double sar2=0.03;
    extern double sar22=0.2;
    extern double SL=0;
    extern double TP=40;
    extern double adx=0;
    extern string info0="Trade on certain Day from 2 to 5";
    extern int day=0;
    extern  string info4="--(Trade every day  ) --";
    extern bool allhr=true;
    extern  string info3="--(Trade hours 0 to 23 Min 0 to 59) --";
    extern int StartHour=1;
    extern int StartMinute=0;
    extern int EndMinute=59;
    extern int EndHour=23;
    //+------------------------------------------------------------------+
    //| expert initialization function                                   |
    //+------------------------------------------------------------------+
    int init()
      {
    //----
       
    //----
       return(0);
      }
    //+------------------------------------------------------------------+
    //| expert deinitialization function                                 |
    //+------------------------------------------------------------------+
    int deinit()
      {
    //----
       
    //----
       return(0);
      }
    //+------------------------------------------------------------------+
    //| expert start function                                            |
    //+------------------------------------------------------------------+
    int start()
      {
    int TIFI=0;//no trade
    if(allhr==false &&day==0&&(Hour()>=StartHour && Minute()>=StartMinute && Minute()<=EndMinute && Hour()<EndHour)){TIFI=1;}
    if(allhr==false &&day>0&&(Hour()>=StartHour && Minute()>=StartMinute && Minute()<=EndMinute && Hour()<EndHour) && DayOfWeek()==day){TIFI=1;}
    if (allhr==true &&(Hour()>=StartHour && Minute()>=StartMinute && Minute()<=EndMinute && Hour()<EndHour)){TIFI=1;}
    
    
      if (Point == 0.00001 || Point == 0.001)  {double range=range1*10*Point;/*if close*/}
    
    //fxsol 4 digits
    if (Point == 0.0001 || Point == 0.01)  {range=range1*Point;/*if close*/} 
    //----end
    int Magic=magic2;
      
    if(SL>0){
    double buysl=   Ask-SL*Point;
    double sellsl=   Bid+SL*Point;}
    else{buysl=0;sellsl=0;}
    
    if(TP>0){     
    double buytp=    Ask+TP*Point;
    double selltp=   Bid-TP*Point;
    }else{buytp=0;selltp=0;}
    int Q=1;
    if(Point==0.00001 || Point== 0.001){Q=10;
    if(SL>0){
     buysl=   Ask-SL*10*Point;
    sellsl=   Bid+SL*10*Point;}
    else{buysl=0;sellsl=0; }
    if(TP>0){     
     buytp=    Ask+TP*10*Point;
    selltp=   Bid-TP*10*Point;
    }else{buytp=0;selltp=0;}
    }
    
    //----
    
    if(
     (iSAR(NULL,0,sar1,sar11,0)<Close[0] && iSAR(NULL,0,sar2,sar22,0)<Close[0])
     ||
     (iSAR(NULL,0,sar1,sar11,0)>Close[0] && iSAR(NULL,0,sar2,sar22,0)>Close[0] ) 
    ){int vibration=0;buyopend=1;sellopend=1;}
    
    
    if(
     (iSAR(NULL,0,sar1,sar11,0)<Close[0] && iSAR(NULL,0,sar2,sar22,0)>Close[0])
     ||
     (iSAR(NULL,0,sar1,sar11,0)>Close[0] && iSAR(NULL,0,sar2,sar22,0)<Close[0] ) 
    ){vibration=1;}
    
    
    if(vibration==1  )
    {
    if(iFractals(NULL, 0, MODE_UPPER,3)>0//up
    ){double dnfrctals=iFractals(NULL, 0, MODE_UPPER,3);if(MyOrdersTotal(Magic)==0)buyopend=0;}
    
    if(iFractals(NULL, 0, MODE_LOWER,3)>0//low
    ){double upfrctals=iFractals(NULL, 0, MODE_LOWER,3);if(MyOrdersTotal(Magic)==0)sellopend=0;}
    
    }
    if(Open[0]<dnfrctals  &&MyOrdersTotal(Magic)==0 && sellopend==0   ){ double LOTS=AccountBalance()*MP/10000;
    OrderSend(Symbol(),OP_SELLSTOP,LOTS,dnfrctals,3,sellsl,selltp,"KSA SELL",magic2,0,Red);sellopend=1;
    }
    
    
    
    if(Open[0]>upfrctals &&MyOrdersTotal(Magic)==0 &&buyopend==0 ){ LOTS=AccountBalance()*MP/10000;
    OrderSend(Symbol(),OP_BUYSTOP,LOTS,upfrctals,3,buysl,buytp,"KSA BUY",magic2,0,Green);buyopend=1;
    }
    
    
    
    string scomment;
    string scomment1="\n Bid= ";
    string scomment2=scomment1 + Bid+ "\n";
    string scomment3=scomment2 ;
    string scomment4=scomment3 + " PSAR" +  "\n";
    string scomment5=scomment4 +"\n";
    string scomment6=scomment5 ;
    string scomment7=scomment6 ;
    string scomment8=scomment7 +"KSA info"+"\n";
    string scomment9=scomment8 +"High="+upfrctals+"\n";
    string scomment10=scomment9 +"LOW="+dnfrctals+"\n";
    string scomment11=scomment10 +MyOrdersTotalreal(magic2)+"\n";   
    string scomment12=scomment11 +"\n";
    string scomment13=scomment12;   
       
       Comment("WWW.URLSAVER.CO.CC \n",scomment12,"|| Spread=",MathAbs((Ask-Bid)/Point)); 
    
    
    //----
       return(0);
      }
    //+------------------------------------------------------------------+
    
    int MyOrdersTotalreal(int Magic)
    {
      int c=0;
      int total  = OrdersTotal();
      
      for (int cnt = 0 ; cnt < total ; cnt++)
      {
        OrderSelect(cnt,SELECT_BY_POS,MODE_TRADES);
        if (OrderMagicNumber() == Magic && OrderSymbol()==Symbol()&& (OrderComment()=="KSA SELL" || OrderComment()=="KSA BUY"))
        { 
          c++;
        }
      }
      return(c);
    }
    
    int MyOrdersTotal(int Magic)
    {
      int c=0;
      int total  = OrdersTotal();
      
      for (int cnt = 0 ; cnt < total ; cnt++)
      {
        OrderSelect(cnt,SELECT_BY_POS,MODE_TRADES);
        if (OrderMagicNumber() == Magic && OrderSymbol()==Symbol())
        {
          c++;
        }
      }
      return(c);
    }
    int delete(int Magic)
    {
      int c=0;
      int total  = OrdersTotal();
      
      for (int cnt = 0 ; cnt < total ; cnt++)
      {
        OrderSelect(cnt,SELECT_BY_POS,MODE_TRADES);
        if (OrderMagicNumber() == Magic && OrderSymbol()==Symbol() && (OrderType()==OP_SELLLIMIT ||OrderType()==OP_BUYLIMIT) )
        {
       OrderDelete(OrderTicket());
        }
      }
      return(c);
    }
    
    
    
    
    int MyOrdersTotalbuy(int Magic)
    {
      int c=0;
      int total  = OrdersTotal();
      
      for (int cnt = 0 ; cnt < total ; cnt++)
      {
        OrderSelect(cnt,SELECT_BY_POS,MODE_TRADES);
        if (OrderMagicNumber() == Magic && OrderSymbol()==Symbol()&& OrderType()==OP_BUY )
        {
          c++;
        }
      }
      return(c);
    }
    
    int MyOrdersTotalsell(int Magic)
    {
      int c=0;
      int total  = OrdersTotal();
      
      for (int cnt = 0 ; cnt < total ; cnt++)
      {
        OrderSelect(cnt,SELECT_BY_POS,MODE_TRADES);
        if (OrderMagicNumber() == Magic && OrderSymbol()==Symbol()&& OrderType()==OP_SELL )
        {
          c++;
        }
      }
      return(c);
    }
    int MyOrdersTotalselllimit(int Magic)
    {
      int c=0;
      int total  = OrdersTotal();
      
      for (int cnt = 0 ; cnt < total ; cnt++)
      {
        OrderSelect(cnt,SELECT_BY_POS,MODE_TRADES);
        if (OrderMagicNumber() == Magic && OrderSymbol()==Symbol()&& OrderType()==OP_SELLLIMIT)
        {
          c++;
        }
      }
      return(c);
    }
    
    int MyOrdersTotalbuylimit(int Magic)
    {
      int c=0;
      int total  = OrdersTotal();
      
      for (int cnt = 0 ; cnt < total ; cnt++)
      {
        OrderSelect(cnt,SELECT_BY_POS,MODE_TRADES);
        if (OrderMagicNumber() == Magic && OrderSymbol()==Symbol()&& OrderType()==OP_BUYLIMIT)
        {
          c++;
        }
      }
      return(c);
    }
    
    int close(int Magic)
    {
      int c=0;
      int total  = OrdersTotal();
      
      for (int cnt = 0 ; cnt < total ; cnt++)
      {
        OrderSelect(cnt,SELECT_BY_POS,MODE_TRADES);
        if (OrderMagicNumber() == Magic && OrderSymbol()==Symbol()  )
        {
       if(OrderType()==OP_SELL)OrderClose(OrderTicket(),OrderLots(),Ask,3,Red);
     if(OrderType()==OP_BUY)OrderClose(OrderTicket(),OrderLots(),Bid,3,Red);
        }
      }
      return(c);
    }
    int close2(int Magic)
    {
      int c=0;
      int total  = OrdersTotal();
      
      for (int cnt = 0 ; cnt < total ; cnt++)
      {
        OrderSelect(cnt,SELECT_BY_POS,MODE_TRADES);
        if (OrderMagicNumber() == Magic   )
        {
       if(OrderType()==OP_SELL)OrderClose(OrderTicket(),OrderLots(),Ask,3,Red);
     if(OrderType()==OP_BUY)OrderClose(OrderTicket(),OrderLots(),Bid,3,Red);
        }
      }
      return(c);
    }
    الصور المصغرة للصور المرفقة الصور المصغرة للصور المرفقة اضغط على الصورة لعرض أكبر

الاســـم:	Presentation1.jpg‏
المشاهدات:	23
الحجـــم:	143.1 كيلوبايت
الرقم:	303839  
    الملفات المرفقة الملفات المرفقة

  2. #2
    تاريخ التسجيل
    Nov 2010
    الإقامة
    المملكة العربية السعودية
    المشاركات
    203

    افتراضي

    لا تزال المشكلة قائمة وهي أنه يفتح الصفقات بمجرد تكون fractals
    وليس بخرقها والإغلاق فوقها