النتائج 1 إلى 10 من 10
  1. #1
    الصورة الرمزية moftah
    moftah غير متواجد حالياً عضو المتداول العربي
    تاريخ التسجيل
    Jan 2008
    الإقامة
    ليبيا
    المشاركات
    856

    افتراضي مطلوب برمجة اكسبريت لمؤشر ZigZag

    السلام عليكم

    اعادة طلب !!!!!!!!!!


    فضلا لا امرا المساعدة في برمجة اكسبريت بمواصفات وهي:
    الذي اريده ان تفتح الصفقة مباشرتنا بيع او شراء عند تكون اول نقطة للزقزاق ( مؤشر ZigZag ) قمة او قاع اي عند رسم الخط الجديد عند النهاية من بداية تكونه ، والهدف يكون عند رسم النقطة الثانية واختياري ، والستوب يكوب اختياري ايضاء من 1 نقطة الي 30 نقطة بأستثناء السبريد لان احتمال تغير نقطة الدخول وارد بنسبة 5 الي 20 ، طبعا يعمل علي كل الفريمات يفضل فريم 5 دقائق وحبدا لو يكون قفل الصفقة علي الفريم الاقل 1 دقيقة ..
    من ميزات طلبي انك تدخل الصفقة من اول نقطة لبداية المنعرج الجديد وفي حالة عكس السعر انا مخير اما قفل الصفقة مباشرتنا بنقطة خسارة او الانتظار حتي 30 نقطة مثلا من فوائد هذا المؤشر الستوب قليل جدا وارباحه كثيرة جدا نسبة تحقيق الهدف 75% ومفيذ لجميع تغيرات السوق.
    ولسرعة تشكيل الخط والفريم صغير جدا وعلي كل العملات يحتاج المؤشر الي اكسبريت نأمل من اخواني الاستجابه لطلبي.
    مرفق رسم توضيحي:
    الصور المصغرة للصور المرفقة الصور المصغرة للصور المرفقة زقزاق.gif‏  

  2. #2
    الصورة الرمزية shael alashour
    shael alashour غير متواجد حالياً عضو المتداول العربي
    تاريخ التسجيل
    Oct 2007
    العمر
    59
    المشاركات
    724

    افتراضي رد: مطلوب برمجة اكسبريت لمؤشر ZigZag

    هذا اكسبرت الزقزاق
    3 انواع منهم
    الصور المصغرة للصور المرفقة الصور المصغرة للصور المرفقة dt-zz.gif‏   xpmazz.gif‏  
    الملفات المرفقة الملفات المرفقة

  3. #3
    الصورة الرمزية moftah
    moftah غير متواجد حالياً عضو المتداول العربي
    تاريخ التسجيل
    Jan 2008
    الإقامة
    ليبيا
    المشاركات
    856

    افتراضي رد: مطلوب برمجة اكسبريت لمؤشر ZigZag

    اقتباس المشاركة الأصلية كتبت بواسطة shael alashour مشاهدة المشاركة
    هذا اكسبرت الزقزاق
    3 انواع منهم
    تسلم يا اخي هل ممكن توضيح لكيفية عمل كل واحد منهم

  4. #4
    الصورة الرمزية goldfile
    goldfile غير متواجد حالياً عضو المتداول العربي
    تاريخ التسجيل
    Mar 2007
    الإقامة
    سانت لوسيا
    المشاركات
    752

    افتراضي رد: مطلوب برمجة اكسبريت لمؤشر ZigZag

    اخي الكريم لا تثق كثيرا بمؤشر الزقزاق ... يمكنك عمل باك تيست لمدة بسيطة جدا

    لتدرك انه مخادع جدا ولا يمكن الوثوق باشاراته

    تحياتي

  5. #5
    الصورة الرمزية moftah
    moftah غير متواجد حالياً عضو المتداول العربي
    تاريخ التسجيل
    Jan 2008
    الإقامة
    ليبيا
    المشاركات
    856

    افتراضي رد: مطلوب برمجة اكسبريت لمؤشر ZigZag

    اقتباس المشاركة الأصلية كتبت بواسطة goldfile مشاهدة المشاركة
    اخي الكريم لا تثق كثيرا بمؤشر الزقزاق ... يمكنك عمل باك تيست لمدة بسيطة جدا

    لتدرك انه مخادع جدا ولا يمكن الوثوق باشاراته

    تحياتي
    شكرا اخي علي نصائحك سنعمل بها وسنكون بالمرصاد لخداعه ولا نمنحه اكثر ما نريد نحن.

  6. #6
    الصورة الرمزية shael alashour
    shael alashour غير متواجد حالياً عضو المتداول العربي
    تاريخ التسجيل
    Oct 2007
    العمر
    59
    المشاركات
    724

    افتراضي رد: مطلوب برمجة اكسبريت لمؤشر ZigZag

    انا لم استعملها فقط جمعتها لك للمساعده
    عموما كلام الاخ صحيح مؤشر الزقزاق هو مؤشر يقيس لك القمم والقيعان حسب الشموع التي تحددها له فهو يكبر ويصغر مع اخر شمعه

  7. #7
    الصورة الرمزية moftah
    moftah غير متواجد حالياً عضو المتداول العربي
    تاريخ التسجيل
    Jan 2008
    الإقامة
    ليبيا
    المشاركات
    856

    افتراضي رد: مطلوب برمجة اكسبريت لمؤشر ZigZag

    اقتباس المشاركة الأصلية كتبت بواسطة shael alashour مشاهدة المشاركة
    انا لم استعملها فقط جمعتها لك للمساعده
    عموما كلام الاخ صحيح مؤشر الزقزاق هو مؤشر يقيس لك القمم والقيعان حسب الشموع التي تحددها له فهو يكبر ويصغر مع اخر شمعه
    صحيح كلامكم وادري به ولكن سنعمل علي فريم صغير جدا عند فتح الصفقة وتقفل الصفقة علي فريم اقل من الاول وعند انعاكس السعر لا نسمح له إلا بأقل ستوب ممكن وكحد أقصي 30 نقطة ، طبعا يفضل العمل علي الفريم 5 دقائق مثلا والقفل علي الدقيقة.
    عند افتتاح السوق اليوم سنجربهم الثلاثة وسنوافيكم بأذن الله بالنتائج.
    اشكركم علي مشاركتم .

  8. #8
    الصورة الرمزية moftah
    moftah غير متواجد حالياً عضو المتداول العربي
    تاريخ التسجيل
    Jan 2008
    الإقامة
    ليبيا
    المشاركات
    856

    افتراضي رد: مطلوب برمجة اكسبريت لمؤشر ZigZag

    ممكن مساعدة اهل الخبرة في معرفة برنامج عمل اكسبريتات الاتية وهل يمكن تغير الفريم وتعديل اي خاصية؟
    مرفق نسخة منها.

    - 1
    //+------------------------------------------------------------------+
    //| DT-ZigZag-Lauer EA.mq4 |
    //| Copyright © 2008, TradingSytemForex |
    //| Trading System Forex - Powered by vBulletin |
    //+------------------------------------------------------------------+

    #property copyright "Copyright © 2008, TradingSytemForex"
    #property link "http://www.tradingsystemforex.com"

    #define OrSt "DT-ZigZag-Lauer EA"

    extern string IS="---------------- Indicator Settings";
    extern int depth=5;
    extern int GrossPeriod=240;
    extern string LM="---------------- Lot Management";
    extern double Lots=0.1;
    extern bool MM=false; //money management
    extern double Risk=10; //risk in percentage
    extern string TSTB="---------------- TP SL TS BE";
    bool RealSL_Enabled=false;
    int RealSL=5; //stop loss under 15 pîps
    bool RealTP_Enabled=false;
    int RealTP=10; //take profit under 10 pîps
    extern int SL=0; //stop loss
    extern int TP=0; //take profit
    extern int TS=0; //trailing stop
    extern int TS_Step=1; //trailing stop step
    extern int BE=0; //breakeven
    extern string EXT="---------------- Extras";
    extern bool Reverse=false;
    extern bool Add_Positions=true; //positions cumulated
    extern int MaxOrders=100; //maximum number of orders
    extern int Magic=0;

    int Slip=3;static int TL=0;double MML=0;

    // expert start function
    int start(){int j=0,limit=1;double BV=0,SV=0;BV=0;SV=0;double DTZ1,DTZ2;
    if(CntO(OP_BUY,Magic)>0) TL=1;if(CntO(OP_SELL,Magic)>0) TL=-1;for(int i=1;i<=limit;i++){

    DTZ1=iCustom(NULL,0,"DT-ZigZag-Lauer",depth,GrossPeriod,0,i);
    DTZ2=iCustom(NULL,0,"DT-ZigZag-Lauer",depth,GrossPeriod,1,i);

    if(DTZ1>0){if(Reverse) SV=1; else BV=1; break;}
    if(DTZ2>0){if(Reverse) BV=1; else SV=1; break;}}

    // expert money management
    if(MM){if(Risk<0.1 || Risk>100) {Comment("Invalid Risk Value."); return(0);}
    else {MML=MathFloor((AccountFreeMargin() *AccountLeverage()*Risk*Point*100)/(Ask*MarketInfo(Symbol(),MODE_LOTSIZE)*MarketInfo( Symbol(),MODE_MINLOT )))*MarketInfo(Symbol(),MODE_MINLOT );}}
    if(MM==false){MML=Lots;}

    // expert init positions
    int cnt=0,OP=0,OS=0,OB=0,CS=0,CB=0;OP=0;for(cnt=0; cnt<OrdersTotal();cnt++) {OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES);
    if((OrderType()==OP_SELL || OrderType()==OP_BUY) && OrderSymbol()==Symbol() && ((OrderMagicNumber()==Magic) || Magic==0)) OP=OP+1;}
    if(OP>=1){OS=0; OB=0;}OB=0;OS=0;CB=0;CS=0;

    // expert conditions to open position
    if(SV>0){OS=1;OB=0;}if(BV>0){OB=1;OS=0;}

    // expert conditions to close position
    if((SV>0) || (RealSL_Enabled && (OrderOpenPrice()-Bid)/Point>=RealSL)||(RealTP_Enabled && (Ask-OrderOpenPrice())/Point>=RealTP)){CB=1;}
    if((BV>0) || (RealSL_Enabled && (Ask-OrderOpenPrice())/Point>=RealSL)||(RealTP_Enabled && (OrderOpenPrice()-Bid)/Point>=RealTP)){CS=1;}
    for(cnt=0;cnt<OrdersTotal();cnt++){OrderSelect(cnt ,SELECT_BY_POS,MODE_TRADES);
    if(OrderType()==OP_BUY && OrderSymbol()==Symbol() && ((OrderMagicNumber()==Magic) || Magic==0)){if (CB==1){OrderClose(OrderTicket(),OrderLots(),Bid,S lip,Red); return(0);}}
    if(OrderType()==OP_SELL && OrderSymbol()==Symbol() && ((OrderMagicNumber()==Magic) || Magic==0)){
    if(CS==1){OrderClose(OrderTicket(),OrderLots(),Ask ,Slip,Red);return(0);}}}double SLI=0,TPI=0;int TK=0;

    // expert open position value
    if((AddP() && Add_Positions && OP<=MaxOrders) || (OP==0 && !Add_Positions)) {
    if(OS==1){if (TP==0) TPI=0; else TPI=Bid-TP*Point;if (SL==0) SLI=0; else SLI=Bid+SL*Point;TK=OrderSend(Symbol(),OP_SELL,MML ,Bid,Slip,SLI,TPI,OrSt,Magic,0,Red);OS=0;return(0) ;}
    if(OB==1){if(TP==0) TPI=0; else TPI=Ask+TP*Point;if(SL==0) SLI=0; else SLI=Ask-SL*Point;TK=OrderSend(Symbol(),OP_BUY,MML,Ask,Slip ,SLI,TPI,OrSt,Magic,0,Lime);OB=0; return(0);}}
    for(j=0;j<OrdersTotal();j++){if(OrderSelect(j,SELE CT_BY_POS, MODE_TRADES)){if (OrderSymbol()==Symbol() && ((OrderMagicNumber()==Magic) || Magic==0)) {TrP();}}}return(0);}

    // expert number of orders
    int CntO(int Type,int Magic){int _CntO;_CntO=0;
    for(int j=0;j<OrdersTotal();j++){OrderSelect(j, SELECT_BY_POS, MODE_TRADES);if(OrderSymbol()==Symbol()) {if((OrderType()==Type && (OrderMagicNumber()==Magic) || Magic==0)) _CntO++;}}return(_CntO);}

    // expert trailing stop
    void TrP(){double pb,pa,pp;pp=MarketInfo(OrderSymbol(),MODE_POINT);i f (OrderType()==OP_BUY){pb=MarketInfo(OrderSymbol(), MODE_BID);

    //expert breakeven
    if(BE>0){if((pb-OrderOpenPrice())>BE*pp){if((OrderStopLoss()-OrderOpenPrice())<0){ModSL(OrderOpenPrice()+0*pp); }}}
    if(TS>0){if((pb-OrderOpenPrice())>TS*pp){if(OrderStopLoss()<pb-(TS+TS_Step-1)*pp){ModSL(pb-TS*pp);return;}}}}
    if(OrderType()==OP_SELL){pa=MarketInfo(OrderSymbol (),MODE_ASK);if(BE>0){if((OrderOpenPrice()-pa)>BE*pp){if((OrderOpenPrice()-OrderStopLoss())<0){ModSL(OrderOpenPrice()-0*pp);}}}
    if (TS>0){if (OrderOpenPrice()-pa>TS*pp){if (OrderStopLoss()>pa+(TS+TS_Step-1)*pp || OrderStopLoss()==0){ModSL(pa+TS*pp);return;}}}}}

    //expert stoploss
    void ModSL(double ldSL){bool fm;fm=OrderModify(OrderTicket(),OrderOpenPrice(),l dSL,OrderTakeProfit(),0,CLR_NONE);}

    //expert add positions function
    bool AddP(){int _num=0; int _ot=0;
    for (int j=0;j<OrdersTotal();j++){if(OrderSelect(j,SELECT_B Y_POS)==true && OrderSymbol()==Symbol() && OrderType()<3 && ((OrderMagicNumber()==Magic) || Magic==0)) {
    _num++;if(OrderOpenTime()>_ot) _ot=OrderOpenTime();}}
    if(_num==0) return(true);if(_num>0 && ((Time[0]-_ot))>0) return(true);else return(false);}

    @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

    2-

    //+------------------------------------------------------------------+
    //| xpMA DT ZigZag EA.mq4 |
    //| Copyright © 2008, TradingSytemForex |
    //| Trading System Forex - Powered by vBulletin |
    //+------------------------------------------------------------------+

    #property copyright "Copyright © 2008, TradingSytemForex"
    #property link "http://www.tradingsystemforex.com"

    #define OrSt "xpMA DT ZigZag EA"

    extern string DTZZ="---------------- DT ZigZag";
    extern int depth=5;
    extern int GrossPeriod=240;
    extern string ZZ="---------------- ZigZag";
    extern int barn=300;
    extern int Length=6;
    extern string XP="---------------- XPMA";
    extern int MA_Period=34;
    extern int MA_Type=8;
    extern int MA_Applied=PRICE_CLOSE;
    extern double T3MA_VolumeFactor=0.8;
    extern double JMA_Phase=0;
    extern string LM="---------------- Lot Management";
    extern double Lots=0.1;
    extern bool MM=false; //money management
    extern double Risk=10; //risk in percentage
    extern string TSTB="---------------- TP SL TS BE";
    bool RealSL_Enabled=false;
    int RealSL=5; //stop loss under 15 pîps
    bool RealTP_Enabled=false;
    int RealTP=10; //take profit under 10 pîps
    extern int SL=0; //stop loss
    extern int TP=0; //take profit
    extern int TS=0; //trailing stop
    extern int TS_Step=1; //trailing stop step
    extern int BE=0; //breakeven
    extern string EXT="---------------- Extras";
    extern bool Reverse=false;
    extern bool Add_Positions=true; //positions cumulated
    extern int MaxOrders=100; //maximum number of orders
    extern int Magic=0;

    int Slip=3;static int TL=0;double MML=0;
    int zigzag=0;

    // expert start function
    int start(){int j=0,limit=1;double BV=0,SV=0;BV=0;SV=0;double XPM1,XPM2,XPM3,XPM4,XPM5,XPM6,DTZ1,DTZ2;
    if(CntO(OP_BUY,Magic)>0) TL=1;if(CntO(OP_SELL,Magic)>0) TL=-1;for(int i=1;i<=limit;i++){

    zigzag=czig(0);

    DTZ1=iCustom(NULL,0,"DT-ZigZag-Lauer",depth,GrossPeriod,0,i);
    DTZ2=iCustom(NULL,0,"DT-ZigZag-Lauer",depth,GrossPeriod,1,i);

    XPM1=iCustom(NULL,0,"xpMA_v2SATL",MA_Period,MA_Typ e,MA_Applied,T3MA_VolumeFactor,JMA_Phase,1,i+1); //down
    XPM2=iCustom(NULL,0,"xpMA_v2SATL",MA_Period,MA_Typ e,MA_Applied,T3MA_VolumeFactor,JMA_Phase,1,i);

    XPM3=iCustom(NULL,0,"xpMA_v2SATL",MA_Period,MA_Typ e,MA_Applied,T3MA_VolumeFactor,JMA_Phase,0,i+1); //mid
    XPM4=iCustom(NULL,0,"xpMA_v2SATL",MA_Period,MA_Typ e,MA_Applied,T3MA_VolumeFactor,JMA_Phase,0,i);

    XPM5=iCustom(NULL,0,"xpMA_v2SATL",MA_Period,MA_Typ e,MA_Applied,T3MA_VolumeFactor,JMA_Phase,2,i+1); //up
    XPM6=iCustom(NULL,0,"xpMA_v2SATL",MA_Period,MA_Typ e,MA_Applied,T3MA_VolumeFactor,JMA_Phase,2,i);

    if(DTZ1>0 && zigzag>0 && XPM5!=EMPTY_VALUE && XPM6!=EMPTY_VALUE && XPM3!=XPM6){if(Reverse) SV=1; else BV=1; break;}
    if(DTZ2>0 && zigzag<0 && XPM1!=EMPTY_VALUE && XPM2!=EMPTY_VALUE && XPM3!=XPM2){if(Reverse) BV=1; else SV=1; break;}}

    // expert money management
    if(MM){if(Risk<0.1 || Risk>100) {Comment("Invalid Risk Value."); return(0);}
    else {MML=MathFloor((AccountFreeMargin() *AccountLeverage()*Risk*Point*100)/(Ask*MarketInfo(Symbol(),MODE_LOTSIZE)*MarketInfo( Symbol(),MODE_MINLOT )))*MarketInfo(Symbol(),MODE_MINLOT );}}
    if(MM==false){MML=Lots;}

    // expert init positions
    int cnt=0,OP=0,OS=0,OB=0,CS=0,CB=0;OP=0;for(cnt=0; cnt<OrdersTotal();cnt++) {OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES);
    if((OrderType()==OP_SELL || OrderType()==OP_BUY) && OrderSymbol()==Symbol() && ((OrderMagicNumber()==Magic) || Magic==0)) OP=OP+1;}
    if(OP>=1){OS=0; OB=0;}OB=0;OS=0;CB=0;CS=0;

    // expert conditions to open position
    if(SV>0){OS=1;OB=0;}if(BV>0){OB=1;OS=0;}

    // expert conditions to close position
    if((SV>0) || (RealSL_Enabled && (OrderOpenPrice()-Bid)/Point>=RealSL)||(RealTP_Enabled && (Ask-OrderOpenPrice())/Point>=RealTP)){CB=1;}
    if((BV>0) || (RealSL_Enabled && (Ask-OrderOpenPrice())/Point>=RealSL)||(RealTP_Enabled && (OrderOpenPrice()-Bid)/Point>=RealTP)){CS=1;}
    for(cnt=0;cnt<OrdersTotal();cnt++){OrderSelect(cnt ,SELECT_BY_POS,MODE_TRADES);
    if(OrderType()==OP_BUY && OrderSymbol()==Symbol() && ((OrderMagicNumber()==Magic) || Magic==0)){if (CB==1){OrderClose(OrderTicket(),OrderLots(),Bid,S lip,Red); return(0);}}
    if(OrderType()==OP_SELL && OrderSymbol()==Symbol() && ((OrderMagicNumber()==Magic) || Magic==0)){
    if(CS==1){OrderClose(OrderTicket(),OrderLots(),Ask ,Slip,Red);return(0);}}}double SLI=0,TPI=0;int TK=0;

    // expert open position value
    if((AddP() && Add_Positions && OP<=MaxOrders) || (OP==0 && !Add_Positions)) {
    if(OS==1){if (TP==0) TPI=0; else TPI=Bid-TP*Point;if (SL==0) SLI=0; else SLI=Bid+SL*Point;TK=OrderSend(Symbol(),OP_SELL,MML ,Bid,Slip,SLI,TPI,OrSt,Magic,0,Red);OS=0;return(0) ;}
    if(OB==1){if(TP==0) TPI=0; else TPI=Ask+TP*Point;if(SL==0) SLI=0; else SLI=Ask-SL*Point;TK=OrderSend(Symbol(),OP_BUY,MML,Ask,Slip ,SLI,TPI,OrSt,Magic,0,Lime);OB=0; return(0);}}
    for(j=0;j<OrdersTotal();j++){if(OrderSelect(j,SELE CT_BY_POS, MODE_TRADES)){if (OrderSymbol()==Symbol() && ((OrderMagicNumber()==Magic) || Magic==0)) {TrP();}}}return(0);}

    // expert number of orders
    int CntO(int Type,int Magic){int _CntO;_CntO=0;
    for(int j=0;j<OrdersTotal();j++){OrderSelect(j, SELECT_BY_POS, MODE_TRADES);if(OrderSymbol()==Symbol()) {if((OrderType()==Type && (OrderMagicNumber()==Magic) || Magic==0)) _CntO++;}}return(_CntO);}

    // expert trailing stop
    void TrP(){double pb,pa,pp;pp=MarketInfo(OrderSymbol(),MODE_POINT);i f (OrderType()==OP_BUY){pb=MarketInfo(OrderSymbol(), MODE_BID);

    //expert breakeven
    if(BE>0){if((pb-OrderOpenPrice())>BE*pp){if((OrderStopLoss()-OrderOpenPrice())<0){ModSL(OrderOpenPrice()+0*pp); }}}
    if(TS>0){if((pb-OrderOpenPrice())>TS*pp){if(OrderStopLoss()<pb-(TS+TS_Step-1)*pp){ModSL(pb-TS*pp);return;}}}}
    if(OrderType()==OP_SELL){pa=MarketInfo(OrderSymbol (),MODE_ASK);if(BE>0){if((OrderOpenPrice()-pa)>BE*pp){if((OrderOpenPrice()-OrderStopLoss())<0){ModSL(OrderOpenPrice()-0*pp);}}}
    if (TS>0){if (OrderOpenPrice()-pa>TS*pp){if (OrderStopLoss()>pa+(TS+TS_Step-1)*pp || OrderStopLoss()==0){ModSL(pa+TS*pp);return;}}}}}

    //expert stoploss
    void ModSL(double ldSL){bool fm;fm=OrderModify(OrderTicket(),OrderOpenPrice(),l dSL,OrderTakeProfit(),0,CLR_NONE);}

    //expert add positions function
    bool AddP(){int _num=0; int _ot=0;
    for (int j=0;j<OrdersTotal();j++){if(OrderSelect(j,SELECT_B Y_POS)==true && OrderSymbol()==Symbol() && OrderType()<3 && ((OrderMagicNumber()==Magic) || Magic==0)) {
    _num++;if(OrderOpenTime()>_ot) _ot=OrderOpenTime();}}
    if(_num==0) return(true);if(_num>0 && ((Time[0]-_ot))>0) return(true);else return(false);}

    //zigzag function
    int czig(int timeframe) {int res=0;int j=0;int limit=500;double zig=0;
    for (int i=0; i<=limit; i++) {double ZZ1=iCustom(NULL,timeframe,"High_Low v2",barn,Length,0,i+1);double ZZ2=iCustom(NULL,timeframe,"High_Low v2",barn,Length,0,i);if (ZZ2>0) {j=i; zig=ZZ2; break;}}
    for (i=j+1; i<=limit; i++) {ZZ1=iCustom(NULL,timeframe,"High_Low v2",barn,Length,0,i+1);ZZ2=iCustom(NULL,timefram e, "High_Low v2",barn,Length,0,i);if (ZZ2>0) {break;}}
    if (zig>ZZ2) {res=-1;}if (zig<ZZ2) {res=1;}return(res);}




    -3
    //+------------------------------------------------------------------+
    //| xpMA ZigZag EA.mq4 |
    //| Copyright © 2008, TradingSytemForex |
    //| Trading System Forex - Powered by vBulletin |
    //+------------------------------------------------------------------+

    #property copyright "Copyright © 2008, TradingSytemForex"
    #property link "http://www.tradingsystemforex.com"

    #define OrSt "xpMA ZigZag EA"

    extern string ZZ="---------------- ZigZag";
    extern int barn=300;
    extern int Length=6;
    extern string XP="---------------- XPMA";
    extern int MA_Period=34;
    extern int MA_Type=8;
    extern int MA_Applied=PRICE_CLOSE;
    extern double T3MA_VolumeFactor=0.8;
    extern double JMA_Phase=0;
    extern string LM="---------------- Lot Management";
    extern double Lots=0.1;
    extern bool MM=false; //money management
    extern double Risk=10; //risk in percentage
    extern string TSTB="---------------- TP SL TS BE";
    bool RealSL_Enabled=false;
    int RealSL=5; //stop loss under 15 pîps
    bool RealTP_Enabled=false;
    int RealTP=10; //take profit under 10 pîps
    extern int SL=0; //stop loss
    extern int TP=0; //take profit
    extern int TS=0; //trailing stop
    extern int TS_Step=1; //trailing stop step
    extern int BE=0; //breakeven
    extern string EXT="---------------- Extras";
    extern bool Reverse=false;
    extern bool Add_Positions=true; //positions cumulated
    extern int MaxOrders=100; //maximum number of orders
    extern int Magic=0;

    int Slip=3;static int TL=0;double MML=0;
    int zigzag=0;

    // expert start function
    int start(){int j=0,limit=1;double BV=0,SV=0;BV=0;SV=0;double XPM1,XPM2,XPM3,XPM4,XPM5,XPM6;
    if(CntO(OP_BUY,Magic)>0) TL=1;if(CntO(OP_SELL,Magic)>0) TL=-1;for(int i=1;i<=limit;i++){

    zigzag=czig(0);

    XPM1=iCustom(NULL,0,"xpMA_v2SATL",MA_Period,MA_Typ e,MA_Applied,T3MA_VolumeFactor,JMA_Phase,1,i+1); //down
    XPM2=iCustom(NULL,0,"xpMA_v2SATL",MA_Period,MA_Typ e,MA_Applied,T3MA_VolumeFactor,JMA_Phase,1,i);

    XPM3=iCustom(NULL,0,"xpMA_v2SATL",MA_Period,MA_Typ e,MA_Applied,T3MA_VolumeFactor,JMA_Phase,0,i+1); //mid
    XPM4=iCustom(NULL,0,"xpMA_v2SATL",MA_Period,MA_Typ e,MA_Applied,T3MA_VolumeFactor,JMA_Phase,0,i);

    XPM5=iCustom(NULL,0,"xpMA_v2SATL",MA_Period,MA_Typ e,MA_Applied,T3MA_VolumeFactor,JMA_Phase,2,i+1); //up
    XPM6=iCustom(NULL,0,"xpMA_v2SATL",MA_Period,MA_Typ e,MA_Applied,T3MA_VolumeFactor,JMA_Phase,2,i);

    if(zigzag>0 && XPM5!=EMPTY_VALUE && XPM6!=EMPTY_VALUE && XPM3!=XPM6){if(Reverse) SV=1; else BV=1; break;}
    if(zigzag<0 && XPM1!=EMPTY_VALUE && XPM2!=EMPTY_VALUE && XPM3!=XPM2){if(Reverse) BV=1; else SV=1; break;}}

    // expert money management
    if(MM){if(Risk<0.1 || Risk>100) {Comment("Invalid Risk Value."); return(0);}
    else {MML=MathFloor((AccountFreeMargin() *AccountLeverage()*Risk*Point*100)/(Ask*MarketInfo(Symbol(),MODE_LOTSIZE)*MarketInfo( Symbol(),MODE_MINLOT )))*MarketInfo(Symbol(),MODE_MINLOT );}}
    if(MM==false){MML=Lots;}

    // expert init positions
    int cnt=0,OP=0,OS=0,OB=0,CS=0,CB=0;OP=0;for(cnt=0; cnt<OrdersTotal();cnt++) {OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES);
    if((OrderType()==OP_SELL || OrderType()==OP_BUY) && OrderSymbol()==Symbol() && ((OrderMagicNumber()==Magic) || Magic==0)) OP=OP+1;}
    if(OP>=1){OS=0; OB=0;}OB=0;OS=0;CB=0;CS=0;

    // expert conditions to open position
    if(SV>0){OS=1;OB=0;}if(BV>0){OB=1;OS=0;}

    // expert conditions to close position
    if((SV>0) || (RealSL_Enabled && (OrderOpenPrice()-Bid)/Point>=RealSL)||(RealTP_Enabled && (Ask-OrderOpenPrice())/Point>=RealTP)){CB=1;}
    if((BV>0) || (RealSL_Enabled && (Ask-OrderOpenPrice())/Point>=RealSL)||(RealTP_Enabled && (OrderOpenPrice()-Bid)/Point>=RealTP)){CS=1;}
    for(cnt=0;cnt<OrdersTotal();cnt++){OrderSelect(cnt ,SELECT_BY_POS,MODE_TRADES);
    if(OrderType()==OP_BUY && OrderSymbol()==Symbol() && ((OrderMagicNumber()==Magic) || Magic==0)){if (CB==1){OrderClose(OrderTicket(),OrderLots(),Bid,S lip,Red); return(0);}}
    if(OrderType()==OP_SELL && OrderSymbol()==Symbol() && ((OrderMagicNumber()==Magic) || Magic==0)){
    if(CS==1){OrderClose(OrderTicket(),OrderLots(),Ask ,Slip,Red);return(0);}}}double SLI=0,TPI=0;int TK=0;

    // expert open position value
    if((AddP() && Add_Positions && OP<=MaxOrders) || (OP==0 && !Add_Positions)) {
    if(OS==1){if (TP==0) TPI=0; else TPI=Bid-TP*Point;if (SL==0) SLI=0; else SLI=Bid+SL*Point;TK=OrderSend(Symbol(),OP_SELL,MML ,Bid,Slip,SLI,TPI,OrSt,Magic,0,Red);OS=0;return(0) ;}
    if(OB==1){if(TP==0) TPI=0; else TPI=Ask+TP*Point;if(SL==0) SLI=0; else SLI=Ask-SL*Point;TK=OrderSend(Symbol(),OP_BUY,MML,Ask,Slip ,SLI,TPI,OrSt,Magic,0,Lime);OB=0; return(0);}}
    for(j=0;j<OrdersTotal();j++){if(OrderSelect(j,SELE CT_BY_POS, MODE_TRADES)){if (OrderSymbol()==Symbol() && ((OrderMagicNumber()==Magic) || Magic==0)) {TrP();}}}return(0);}

    // expert number of orders
    int CntO(int Type,int Magic){int _CntO;_CntO=0;
    for(int j=0;j<OrdersTotal();j++){OrderSelect(j, SELECT_BY_POS, MODE_TRADES);if(OrderSymbol()==Symbol()) {if((OrderType()==Type && (OrderMagicNumber()==Magic) || Magic==0)) _CntO++;}}return(_CntO);}

    // expert trailing stop
    void TrP(){double pb,pa,pp;pp=MarketInfo(OrderSymbol(),MODE_POINT);i f (OrderType()==OP_BUY){pb=MarketInfo(OrderSymbol(), MODE_BID);

    //expert breakeven
    if(BE>0){if((pb-OrderOpenPrice())>BE*pp){if((OrderStopLoss()-OrderOpenPrice())<0){ModSL(OrderOpenPrice()+0*pp); }}}
    if(TS>0){if((pb-OrderOpenPrice())>TS*pp){if(OrderStopLoss()<pb-(TS+TS_Step-1)*pp){ModSL(pb-TS*pp);return;}}}}
    if(OrderType()==OP_SELL){pa=MarketInfo(OrderSymbol (),MODE_ASK);if(BE>0){if((OrderOpenPrice()-pa)>BE*pp){if((OrderOpenPrice()-OrderStopLoss())<0){ModSL(OrderOpenPrice()-0*pp);}}}
    if (TS>0){if (OrderOpenPrice()-pa>TS*pp){if (OrderStopLoss()>pa+(TS+TS_Step-1)*pp || OrderStopLoss()==0){ModSL(pa+TS*pp);return;}}}}}

    //expert stoploss
    void ModSL(double ldSL){bool fm;fm=OrderModify(OrderTicket(),OrderOpenPrice(),l dSL,OrderTakeProfit(),0,CLR_NONE);}

    //expert add positions function
    bool AddP(){int _num=0; int _ot=0;
    for (int j=0;j<OrdersTotal();j++){if(OrderSelect(j,SELECT_B Y_POS)==true && OrderSymbol()==Symbol() && OrderType()<3 && ((OrderMagicNumber()==Magic) || Magic==0)) {
    _num++;if(OrderOpenTime()>_ot) _ot=OrderOpenTime();}}
    if(_num==0) return(true);if(_num>0 && ((Time[0]-_ot))>0) return(true);else return(false);}

    //zigzag function
    int czig(int timeframe) {int res=0;int j=0;int limit=500;double zig=0;
    for (int i=0; i<=limit; i++) {double ZZ1=iCustom(NULL,timeframe,"High_Low v2",barn,Length,0,i+1);double ZZ2=iCustom(NULL,timeframe,"High_Low v2",barn,Length,0,i);if (ZZ2>0) {j=i; zig=ZZ2; break;}}
    for (i=j+1; i<=limit; i++) {ZZ1=iCustom(NULL,timeframe,"High_Low v2",barn,Length,0,i+1);ZZ2=iCustom(NULL,timeframe, "High_Low v2",barn,Length,0,i);if (ZZ2>0) {break;}}
    if (zig>ZZ2) {res=-1;}if (zig<ZZ2) {res=1;}return(res);}






    @@@@@@@@@@@@@@@@@@@@@@@@@@@@


    -4
    //+------------------------------------------------------------------+
    //| ZigZagEvgeTrofi 1.mq4 |
    //| Copyright © 2008, MetaQuotes Software Corp. |
    //| Forex Trading Software: Forex Trading Platform MetaTrader 4 |
    //+------------------------------------------------------------------+
    #property copyright "Copyright © 2008, Trofimov Evgeniy"
    #property link "http://www.fracpar.narod.ru/"

    #define MAGICMA 20080919
    #define Slippage 5

    //---- indicator parameters
    extern int ExtDepth=17; //10-21 !15 !17
    extern int ExtDeviation=7; //!7
    extern int ExtBackstep=5; //!5
    extern double Lot=0.10;
    extern double SL=50;
    extern double TP=50;
    extern bool MoneyManagement=True;
    extern double Risk=2;
    //----
    static int prevtime = 0;
    int Urgency=2;

    //+------------------------------------------------------------------+
    //| expert start function |
    //+------------------------------------------------------------------+
    int start()
    {
    //----
    int i, candle;
    double ZigZag;
    int CurrentCondition, Signal;

    if (! IsTradeAllowed()) {
    prevtime = Time[1];
    MathSrand(TimeCurrent());
    Sleep(30000 + MathRand());
    return(0);
    }
    if (Time[0] == prevtime) return(0);
    prevtime = Time[0];
    while(candle<100)
    {
    ZigZag=iCustom(NULL,0,"ZigZag", ExtDepth,ExtDeviation,ExtBackstep, 0,candle);
    if(ZigZag!=0) break;
    candle++;
    }
    if(candle>99) return(0);
    if(ZigZag==High[candle])
    Signal=1;
    else if(ZigZag==Low[candle])
    Signal=2;
    int total = OrdersTotal();
    for (i = 0; i < total; i++) {
    OrderSelect(i, SELECT_BY_POS, MODE_TRADES);
    if (OrderSymbol() == Symbol() && OrderMagicNumber() == MAGICMA) {
    CurrentCondition=OrderType()+1;
    break;
    }
    }

    if(Signal==CurrentCondition) return(0);
    if(Signal!=CurrentCondition && CurrentCondition>0)
    {
    if(CurrentCondition==1)
    OrderClose(OrderTicket(),OrderLots(),Bid,Slippage) ;
    else
    OrderClose(OrderTicket(),OrderLots(),Ask,Slippage) ;
    Sleep(20000);
    RefreshRates();
    }

    //Money Management sequence
    if (MoneyManagement)
    {
    if (Risk<1 || Risk>100)
    {
    Comment("Invalid Risk Value.");
    return(0);
    }
    else
    {
    Lot=MathFloor((AccountFreeMargin() *AccountLeverage()*Risk*Point*100)/(Ask*MarketInfo(Symbol(), MODE_LOTSIZE)*MarketInfo(Symbol(),MODE_MINLOT )))*MarketInfo(Symbol(),MODE_MINLOT );
    }
    }

    if(candle<=Urgency)
    {
    if(Signal==1)
    OrderSend(Symbol(), OP_BUY, Lot, Ask, Slippage, Ask - SL * Point, Ask + TP * Point, "ZigZag", MAGICMA, 0, Blue);
    else
    OrderSend(Symbol(), OP_SELL, Lot, Bid, Slippage, Bid + SL * Point,Bid - TP * Point, "ZigZag", MAGICMA, 0, Red);
    Sleep(20000);
    prevtime = Time[1];
    }



    //----
    return(0);
    }
    //+------------------------------------------------------------------+




  9. #9
    الصورة الرمزية hussain2015
    hussain2015 غير متواجد حالياً عضو المتداول العربي
    تاريخ التسجيل
    Sep 2008
    العمر
    50
    المشاركات
    67

    افتراضي رد: مطلوب برمجة اكسبريت لمؤشر ZigZag

    والله انا اؤيد الاخوة في هذا واعتقد الزيج زاج غير فعال لوحده

  10. #10
    الصورة الرمزية سامح الجندي
    سامح الجندي غير متواجد حالياً عضو المتداول العربي
    تاريخ التسجيل
    Mar 2009
    المشاركات
    585

    افتراضي رد: مطلوب برمجة اكسبريت لمؤشر ZigZag

    ماكان حد غلب

المواضيع المتشابهه

  1. مطلوب برمجة مؤشر
    By ellliottt in forum برمجة المؤشرات واكسبرتات التداول - Experts Advisor EA
    مشاركات: 19
    آخر مشاركة: 24-05-2011, 07:56 AM
  2. ارجو منكم المساعدة في برمجة اكسبريت
    By rahhal in forum برمجة المؤشرات واكسبرتات التداول - Experts Advisor EA
    مشاركات: 1
    آخر مشاركة: 11-04-2010, 06:11 PM
  3. مطلوب برمجة مؤشر
    By علي حسن in forum برمجة المؤشرات واكسبرتات التداول - Experts Advisor EA
    مشاركات: 1
    آخر مشاركة: 29-01-2010, 08:12 PM
  4. طلب مساعدة بتصحيح خطا في برمجة اكسبريت
    By متعلم1 in forum برمجة المؤشرات واكسبرتات التداول - Experts Advisor EA
    مشاركات: 4
    آخر مشاركة: 07-06-2009, 11:28 PM
  5. طلب برمجة اكسبريت ماخود من استراتيجية سوبلكس للمضاعفات
    By ابن المدينة in forum برمجة المؤشرات واكسبرتات التداول - Experts Advisor EA
    مشاركات: 8
    آخر مشاركة: 15-05-2008, 03:35 PM

الاوسمة لهذا الموضوع


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