صفحة 1 من 2 12 الأخيرةالأخيرة
النتائج 1 إلى 15 من 28

الموضوع: RSI

  1. #1
    تاريخ التسجيل
    Mar 2020
    الإقامة
    السعودية
    المشاركات
    8,531

    افتراضي RSI

    بنية تحتية ممكن تبني عليها
    كود:
    datetime time;
    int ii=1;
    int jj=1;
    void OnTick()
    {
       if(time!=Time[0])
       {
          time=Time[0];
          double rsi2=iRSI(NULL,0,14,PRICE_CLOSE,2);
          double rsi1=iRSI(NULL,0,14,PRICE_CLOSE,1);
          if(rsi2>30 && rsi1<30)
          {
             double lotsB=ii*0.01;
             jj=1;
             int tickBuy=OrderSend(Symbol(),OP_BUY,lotsB,Ask,3,0,0,"B",1234,0,clrBlue);
             ii++;
          }
          else if(rsi2<70 && rsi1>70)
          {
             double lotsS=jj*0.01;
             ii=1;
             int tickSell=OrderSend(Symbol(),OP_SELL,lotsS,Bid,3,0,0,"S",1234,0,clrRed);
             jj++;
          }
          for(int i=OrdersTotal()-1;i>=0;i--)
          {
             if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)) 
             {
                if(OrderType()==OP_SELL && rsi2<30 && rsi1>30)
                {
                   bool aa1=OrderClose(OrderTicket(),OrderLots(),Ask,3,clrRed);
                }
                if(OrderType()==OP_BUY && rsi2>70 && rsi1<70)
                {
                   bool aa2=OrderClose(OrderTicket(),OrderLots(),Bid,3,clrBlue);
                }
             } 
          }
       }
    }

  2. #2
    الصورة الرمزية nirvano
    nirvano غير متواجد حالياً عضو المتداول العربي
    تاريخ التسجيل
    Aug 2018
    الإقامة
    الجزائر
    المشاركات
    282

    افتراضي

    نعم لتشجيع اكسبرتات rsi
    شكرا على مشاركتك اخي الكريم

  3. #3
    تاريخ التسجيل
    Mar 2020
    الإقامة
    السعودية
    المشاركات
    8,531

    افتراضي

    تجربة مضاعفات اللوتات مع كل قطع عكسي:

    وهذا لاينفي حقيقة ان المؤشرات كلها ففتي ففتي:


    ب

  4. #4
    تاريخ التسجيل
    Mar 2020
    الإقامة
    السعودية
    المشاركات
    8,531

    افتراضي

    اغلب التجارب تضرب مارجن
    الان نظرية ن\2
    يعني ادخل نصف التقاطعات العكسية
    ادخل مع اول تقاطع
    تجاهل ثاني تقاطع
    ادخل مع ثالث تقاطع
    تجاهل رابع تقاطع
    وهكذا
    تحت التجربة نظرية: ن\2

  5. #5
    تاريخ التسجيل
    Mar 2020
    الإقامة
    السعودية
    المشاركات
    8,531

    افتراضي

    قبل ن\2:

  6. #6
    تاريخ التسجيل
    Mar 2020
    الإقامة
    السعودية
    المشاركات
    8,531

    افتراضي

    بعد ن\2: بنفس الشروط لنفس الزوج ونفس الفريم:

  7. #7
    تاريخ التسجيل
    Mar 2020
    الإقامة
    السعودية
    المشاركات
    8,531

    افتراضي

    كود:
    datetime time;
    int ii=-1;
    int jj=-1;
    double limiter=1.00;
    int crossIIJJ=1;
    int II=0;
    int JJ=0;
    double priceB=Ask;
    double priceS=Bid;
    double pipsD=1000;
    void OnTick()
    {
       Comment("ii=",ii," II=",II,"  ------     jj=",jj," JJ=",JJ);
       if(time!=Time[0])
       {
          time=Time[0];
          double rsi2=iRSI(NULL,0,14,PRICE_CLOSE,2);
          double rsi1=iRSI(NULL,0,14,PRICE_CLOSE,1);
          if(rsi2>=30 && rsi1<=30)
          {
             ii++;
             jj=-1;
             if(MathMod(ii,crossIIJJ)==0)
             {
                Print("AAAAAAAAAAAAAAAAAAAAAAA");
                double lotsB=MathPow(2,II)*0.01;
                if(lotsB>limiter)lotsB=limiter;
                if(ii==0)
                {
                   int tickBuy=OrderSend(Symbol(),OP_BUY,lotsB,Ask,3,0,0,"B",1234,0,clrBlue);
                   priceB=Ask;
                II++;
                JJ=0;
                }
                else if(Ask<(priceB-pipsD*_Point))
                {
                   tickBuy=OrderSend(Symbol(),OP_BUY,lotsB,Ask,3,0,0,"B",1234,0,clrBlue);
                   priceB=Ask;
                II++;
                JJ=0;
                }
             }
          }
          else if(rsi2<=70 && rsi1>=70)
          {
             ii=-1;
             jj++;
          if(MathMod(jj,crossIIJJ)==0)
          {
             double lotsS=MathPow(2,JJ)*0.01;
             if(lotsS>limiter)lotsS=limiter;
             if(jj==0)
             {
             int tickSell=OrderSend(Symbol(),OP_SELL,lotsS,Bid,3,0,0,"S",1234,0,clrRed);         
             priceS=Bid;
             JJ++;
             II=0;
             }
             else if(Bid>(priceS+pipsD*_Point))
             {
             
             tickSell=OrderSend(Symbol(),OP_SELL,lotsS,Bid,3,0,0,"S",1234,0,clrRed); 
             priceS=Bid;
             JJ++;
             II=0;
             }
    
          }
          }
          for(int i=OrdersTotal()-1;i>=0;i--)
          {
             if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)) 
             {
                if(OrderType()==OP_SELL && rsi2<=30 && rsi1>=30)
                {
                   bool aa1=OrderClose(OrderTicket(),OrderLots(),Ask,3,clrRed);
                }
                if(OrderType()==OP_BUY && rsi2>=70 && rsi1<=70)
                {
                   bool aa2=OrderClose(OrderTicket(),OrderLots(),Bid,3,clrBlue);
                }
             } 
          }
       }
    }

  8. #8
    تاريخ التسجيل
    Mar 2020
    الإقامة
    السعودية
    المشاركات
    8,531

    افتراضي

    الكود اعلاه مطور:
    لوتات مضاعفات
    ن=1
    لاينفذ اي امر تقطاع عكسي جديد الا اذا كان الامر السابق عاكس 100 نقطة

    سنطبقه على المجنون ونطرح صورة:

  9. #9
    تاريخ التسجيل
    Mar 2020
    الإقامة
    السعودية
    المشاركات
    8,531

    افتراضي



    متوقعة ان تكون افضل
    اذا اردت تعميمه على زوجين اجعل ن =2 بحيث تقسم المخاطرة

    جربوه

  10. #10
    تاريخ التسجيل
    Mar 2020
    الإقامة
    السعودية
    المشاركات
    8,531

    افتراضي

    لاحظ في الصور اعلاه الفرق بين كل امرين متتالين نقاط كثيرة وبالتالي فلترنا التقطعات المتقاربة زمنيا ونقطياً--شوية ذكاء يعني

    نعني ب ن المتغير int crossIIJJ=1; في الخبير

    قراءة الكود اساسا تبين لك هدف هذا المتغير
    آخر تعديل بواسطة سلمان_العتيبي ، 25-11-2021 الساعة 06:14 AM

  11. #11
    تاريخ التسجيل
    Mar 2020
    الإقامة
    السعودية
    المشاركات
    8,531

    افتراضي

    double pipsD=1000;
    وهذا المتغير بالبوينت نعني به الفرق بين كل امرين متتالين

    1000 بوينت تعني 100 ببز او نقطة
    تعامل بالبوينت وتخلص من مفاهيم خاطئة تربوا عليها من عاصروا المنتديات من اولها -- فحملوا هذا الوباء معهم

  12. #12
    تاريخ التسجيل
    Mar 2020
    الإقامة
    السعودية
    المشاركات
    8,531

    افتراضي

    يحفظ تحت مؤشرات--تقاطع اثنين RSI

    كود:
    //+------------------------------------------------------------------+
    //|                                                          RSI.mq4 |
    //|                   Copyright 2005-2014, MetaQuotes Software Corp. |
    //|                                              http://www.mql4.com |
    //+------------------------------------------------------------------+
    #property copyright   "2005-2014, MetaQuotes Software Corp."
    #property link        "http://www.mql4.com"
    #property description "Relative Strength Index"
    #property strict
    
    #property indicator_separate_window
    #property indicator_minimum    0
    #property indicator_maximum    100
    #property indicator_buffers    6
    #property indicator_color1     clrYellow
    #property indicator_color2     clrNONE
    #property indicator_color3     clrNONE
    #property indicator_color4     clrRed
    #property indicator_color5     clrNONE
    #property indicator_color6     clrNONE
    #property indicator_level1     30.0
    #property indicator_level2     70.0
    #property indicator_levelcolor clrSilver
    #property indicator_levelstyle STYLE_DOT
    //--- input parameters
    input int InpRSIPeriod=14; // RSI Period
    input int InpRSIPeriod1=5; // RSI Period
    //--- buffers
    double ExtRSIBuffer[];
    double ExtPosBuffer[];
    double ExtNegBuffer[];
    double ExtRSIBuffer1[];
    double ExtPosBuffer1[];
    double ExtNegBuffer1[];
    //+------------------------------------------------------------------+
    //| Custom indicator initialization function                         |
    //+------------------------------------------------------------------+
    int OnInit(void)
      {
       string short_name;
    //--- 2 additional buffers are used for counting.
       IndicatorBuffers(6);
       SetIndexBuffer(1,ExtPosBuffer);
       SetIndexBuffer(2,ExtNegBuffer);
       SetIndexBuffer(4,ExtPosBuffer1);
       SetIndexBuffer(5,ExtNegBuffer1);
    //--- indicator line
       SetIndexStyle(0,DRAW_LINE);
       SetIndexStyle(3,DRAW_LINE);
       SetIndexBuffer(0,ExtRSIBuffer);
       SetIndexBuffer(3,ExtRSIBuffer1);
    //--- name for DataWindow and indicator subwindow label
       short_name="RSI("+string(InpRSIPeriod1)+"/"+string(InpRSIPeriod)+")";
       IndicatorShortName(short_name);
       SetIndexLabel(0,"A");
       //SetIndexLabel(1,"B");
       //SetIndexLabel(2,"C");
       SetIndexLabel(3,"D");
       //SetIndexLabel(4,"E");
       //SetIndexLabel(5,"F");
    //--- check for input
       if(InpRSIPeriod<2)
         {
          Print("Incorrect value for input variable InpRSIPeriod = ",InpRSIPeriod);
          return(INIT_FAILED);
         }
    //---
       SetIndexDrawBegin(0,InpRSIPeriod);
    //--- initialization done
       return(INIT_SUCCEEDED);
      }
    //+------------------------------------------------------------------+
    //| Relative Strength Index                                          |
    //+------------------------------------------------------------------+
    int OnCalculate(const int rates_total,
                    const int prev_calculated,
                    const datetime &time[],
                    const double &open[],
                    const double &high[],
                    const double &low[],
                    const double &close[],
                    const long &tick_volume[],
                    const long &volume[],
                    const int &spread[])
      {
       int    i,pos;
       double diff;
    //---
       int    i1,pos1;
       double diff1;
       if(Bars<=InpRSIPeriod || InpRSIPeriod<2)
          return(0);
    //--- counting from 0 to rates_total
       ArraySetAsSeries(ExtRSIBuffer,false);
       ArraySetAsSeries(ExtPosBuffer,false);
       ArraySetAsSeries(ExtNegBuffer,false);
       ArraySetAsSeries(close,false);
       ArraySetAsSeries(ExtRSIBuffer1,false);
       ArraySetAsSeries(ExtPosBuffer1,false);
       ArraySetAsSeries(ExtNegBuffer1,false);
    //--- preliminary calculations
       pos=prev_calculated-1;
       if(pos<=InpRSIPeriod)
         {
          //--- first RSIPeriod values of the indicator are not calculated
          ExtRSIBuffer[0]=0.0;
          ExtPosBuffer[0]=0.0;
          ExtNegBuffer[0]=0.0;
          double sump=0.0;
          double sumn=0.0;
          for(i=1; i<=InpRSIPeriod; i++)
            {
             ExtRSIBuffer[i]=0.0;
             ExtPosBuffer[i]=0.0;
             ExtNegBuffer[i]=0.0;
             diff=close[i]-close[i-1];
             if(diff>0)
                sump+=diff;
             else
                sumn-=diff;
            }
          //--- calculate first visible value
          ExtPosBuffer[InpRSIPeriod]=sump/InpRSIPeriod;
          ExtNegBuffer[InpRSIPeriod]=sumn/InpRSIPeriod;
          if(ExtNegBuffer[InpRSIPeriod]!=0.0)
             ExtRSIBuffer[InpRSIPeriod]=100.0-(100.0/(1.0+ExtPosBuffer[InpRSIPeriod]/ExtNegBuffer[InpRSIPeriod]));
          else
            {
             if(ExtPosBuffer[InpRSIPeriod]!=0.0)
                ExtRSIBuffer[InpRSIPeriod]=100.0;
             else
                ExtRSIBuffer[InpRSIPeriod]=50.0;
            }
          //--- prepare the position value for main calculation
          pos=InpRSIPeriod+1;
         }
    //--- the main loop of calculations
       for(i=pos; i<rates_total && !IsStopped(); i++)
         {
          diff=close[i]-close[i-1];
          ExtPosBuffer[i]=(ExtPosBuffer[i-1]*(InpRSIPeriod-1)+(diff>0.0?diff:0.0))/InpRSIPeriod;
          ExtNegBuffer[i]=(ExtNegBuffer[i-1]*(InpRSIPeriod-1)+(diff<0.0?-diff:0.0))/InpRSIPeriod;
          if(ExtNegBuffer[i]!=0.0)
             ExtRSIBuffer[i]=100.0-100.0/(1+ExtPosBuffer[i]/ExtNegBuffer[i]);
          else
            {
             if(ExtPosBuffer[i]!=0.0)
                ExtRSIBuffer[i]=100.0;
             else
                ExtRSIBuffer[i]=50.0;
            }
         }
    //---
    
       pos1=prev_calculated-1;
       if(pos1<=InpRSIPeriod1)
         {
          //--- first RSIPeriod values of the indicator are not calculated
          ExtRSIBuffer1[0]=0.0;
          ExtPosBuffer1[0]=0.0;
          ExtNegBuffer1[0]=0.0;
          double sump1=0.0;
          double sumn1=0.0;
          for(i1=1; i1<=InpRSIPeriod1; i1++)
            {
             ExtRSIBuffer1[i1]=0.0;
             ExtPosBuffer1[i1]=0.0;
             ExtNegBuffer1[i1]=0.0;
             diff1=close[i1]-close[i1-1];
             if(diff1>0)
                sump1+=diff1;
             else
                sumn1-=diff1;
            }
          //--- calculate first visible value
          ExtPosBuffer1[InpRSIPeriod1]=sump1/InpRSIPeriod1;
          ExtNegBuffer1[InpRSIPeriod1]=sumn1/InpRSIPeriod1;
          if(ExtNegBuffer1[InpRSIPeriod1]!=0.0)
             ExtRSIBuffer1[InpRSIPeriod1]=100.0-(100.0/(1.0+ExtPosBuffer1[InpRSIPeriod1]/ExtNegBuffer1[InpRSIPeriod1]));
          else
            {
             if(ExtPosBuffer1[InpRSIPeriod1]!=0.0)
                ExtRSIBuffer1[InpRSIPeriod1]=100.0;
             else
                ExtRSIBuffer1[InpRSIPeriod1]=50.0;
            }
          //--- prepare the position value for main calculation
          pos1=InpRSIPeriod1+1;
         }
    //--- the main loop of calculations
       for(i1=pos1; i1<rates_total && !IsStopped(); i1++)
         {
          diff1=close[i1]-close[i1-1];
          ExtPosBuffer1[i1]=(ExtPosBuffer1[i1-1]*(InpRSIPeriod1-1)+(diff1>0.0?diff1:0.0))/InpRSIPeriod1;
          ExtNegBuffer1[i1]=(ExtNegBuffer1[i1-1]*(InpRSIPeriod1-1)+(diff1<0.0?-diff1:0.0))/InpRSIPeriod1;
          if(ExtNegBuffer1[i1]!=0.0)
             ExtRSIBuffer1[i1]=100.0-100.0/(1+ExtPosBuffer1[i1]/ExtNegBuffer1[i1]);
          else
            {
             if(ExtPosBuffer1[i1]!=0.0)
                ExtRSIBuffer1[i1]=100.0;
             else
                ExtRSIBuffer1[i1]=50.0;
            }
         }
    //---
    
    
    
    
       return(rates_total);
      }
    //+------------------------------------------------------------------+

  13. #13
    الصورة الرمزية BIGRISK
    BIGRISK غير متواجد حالياً عضو المتداول العربي
    تاريخ التسجيل
    Nov 2021
    الإقامة
    كندا
    المشاركات
    91

    افتراضي

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

    لا يفوتني شكرك على كل المعلومات القيمة اللتي طرحتها بخصوص rsi ..... لا ادري اعتقد اني شاهدة صور نتأج لاكسبيرت و الان هي لا تظهر!!!

    في رأيك هل الصفقات المعلقة بعد ظهور اشارة على المؤشر مناسبة لتحسين نتائج الاستراتجية

  14. #14
    تاريخ التسجيل
    Mar 2020
    الإقامة
    السعودية
    المشاركات
    8,531

    افتراضي

    اقتباس المشاركة الأصلية كتبت بواسطة BIGRISK مشاهدة المشاركة
    السلام عليكم ورحمة الله

    لا يفوتني شكرك على كل المعلومات القيمة اللتي طرحتها بخصوص rsi ..... لا ادري اعتقد اني شاهدة صور نتأج لاكسبيرت و الان هي لا تظهر!!!

    في رأيك هل الصفقات المعلقة بعد ظهور اشارة على المؤشر مناسبة لتحسين نتائج الاستراتجية
    كما ذكرت في موضوعك هنا تبني عليه نضيف متغيرين ل RSI-5

    اضفتها: ممكن تعدل عليه
    كود:
    datetime time;
    int ii=-1;
    int jj=-1;
    double limiter=50;
    int N=1;
    int II=0;
    int JJ=0;
    double priceB=Ask;
    double priceS=Bid;
    double pipsD=-8880;
    void OnTick()
    {
       Comment("ii=",ii," II=",II,"  ------     jj=",jj," JJ=",JJ,"\n \nEquity: ",AccountEquity());
       if(time!=Time[0])
       {
          time=Time[0];
          double rsi_2_14=iRSI(NULL,0,14,PRICE_CLOSE,2);
          double rsi_1_14=iRSI(NULL,0,14,PRICE_CLOSE,1);
          double rsi_2_5=iRSI(NULL,0,5,PRICE_CLOSE,2);
          double rsi_1_5=iRSI(NULL,0,5,PRICE_CLOSE,1);
          if(rsi_2_5<=rsi_2_14 && rsi_1_5>=rsi_1_14)
          {
             ii++;
             jj=-1;
             if(MathMod(ii,N)==0)
             {
                double lotsB=MathPow(2,II)*0.01;
                if(lotsB>limiter)lotsB=limiter;
                if(ii==0)
                {
                   int tickBuy=OrderSend(Symbol(),OP_BUY,lotsB,Ask,3,0,0,"B",1234,0,clrBlue);
                   priceB=Ask;
                II++;
                JJ=0;
                }
                else if(Ask<(priceB-pipsD*_Point))
                {
                   tickBuy=OrderSend(Symbol(),OP_BUY,lotsB,Ask,3,0,0,"B",1234,0,clrBlue);
                   priceB=Ask;
                II++;
                JJ=0;
                }
             }
          }
          else if(rsi_2_5>=rsi_2_14 && rsi_1_5<=rsi_1_14)
          {
             ii=-1;
             jj++;
          if(MathMod(jj,N)==0)
          {
             double lotsS=MathPow(2,JJ)*0.01;
             if(lotsS>limiter)lotsS=limiter;
             if(jj==0)
             {
             int tickSell=OrderSend(Symbol(),OP_SELL,lotsS,Bid,3,0,0,"S",1234,0,clrRed);         
             priceS=Bid;
             JJ++;
             II=0;
             }
             else if(Bid>(priceS+pipsD*_Point))
             {
             
             tickSell=OrderSend(Symbol(),OP_SELL,lotsS,Bid,3,0,0,"S",1234,0,clrRed); 
             priceS=Bid;
             JJ++;
             II=0;
             }
    
          }
          }
          for(int i=OrdersTotal()-1;i>=0;i--)
          {
             if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)) 
             {
                if(OrderType()==OP_SELL && rsi_2_5<=rsi_2_14 && rsi_1_5>=rsi_1_14)
                {
             double orderProfitB=(-Ask+OrderOpenPrice())/_Point;
             //if(orderProfitB>TP)
                   bool aa1=OrderClose(OrderTicket(),OrderLots(),Ask,3,clrRed);
                }
                if(OrderType()==OP_BUY && rsi_2_5>=rsi_2_14 && rsi_1_5<=rsi_1_14)
                {
             double orderProfitS=(Bid-OrderOpenPrice())/_Point;
             //if(orderProfitS>TP)
                   bool aa2=OrderClose(OrderTicket(),OrderLots(),Bid,3,clrBlue);
                }
             } 
          }
       }
    }
    
    double TP=50;

  15. #15
    تاريخ التسجيل
    Mar 2020
    الإقامة
    السعودية
    المشاركات
    8,531

    افتراضي

    كود:
    double rsi_2_5=iRSI(NULL,0,5,PRICE_CLOSE,2);
    double rsi_1_5=iRSI(NULL,0,5,PRICE_CLOSE,1);
    آخر تعديل بواسطة سلمان_العتيبي ، 27-11-2021 الساعة 09:36 PM

صفحة 1 من 2 12 الأخيرةالأخيرة

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17