Google Search Result

Double Parabolic SAR EA  

Posted by Azrul in

Here code for Double Parabolic SAR EA. just copy and paste to your metaeditor and save. then run your metarader. but I never guarantee any results.


extern string PS1="---------------- Parabolic SAR1";
extern double Step1=0.02;
extern double Maximum1=0.2;
extern double TimeFrame1=0;
extern string PS2="---------------- Parabolic SAR2";
extern double Step2=0.08;
extern double Maximum2=0.2;
extern double TimeFrame2=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 bool Martingale=false; //martingale
extern double Multiplier=1.5; //multiplier
extern double MinProfit=0; //minimum profit to apply the martingale
extern string TSTB="---------------- TP SL TS BE";
bool EnableRealSL=false;
int RealSL=5; //stop loss under 15 pîps
bool EnableRealTP=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
int TSStep=1; //trailing step
extern int BE=0; //breakeven
extern string EXT="---------------- Extras";
extern bool Reverse=false;
extern bool AddPositions=false; //positions cumulated
extern int MaxOrders=100; //maximum number of orders
extern bool MAFilter=false; //moving average filter
extern int MAPeriod=20;
extern int MAMethod=1;
extern int MAPrice=0;
extern bool TimeFilter=false; //time filter
extern int StartHour=8;
extern int EndHour=21;
extern int Magic=0;

int Slip=3;static int TL=0;double Balance=0.0;int err=0;int TK;


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


string TIFI="false";
if(TimeFilter){if(!(Hour()>=StartHour && Hour()<=EndHour)){TIFI="true";}}
double MAF=iMA(Symbol(),0,MAPeriod,0,MAMethod,MAPrice,i);
string MAFIB="false";string MAFIS="false";
if(MAFilter){if(Bid>MAF)MAFIB="true";if(Ask


double PSA1=iSAR(NULL,TimeFrame1,Step1,Maximum1,i+1);
double PSA2=iSAR(NULL,TimeFrame1,Step1,Maximum1,i);
double PSA3=iSAR(NULL,TimeFrame2,Step2,Maximum2,i+1);
double PSA4=iSAR(NULL,TimeFrame2,Step2,Maximum2,i);


string SBUY="false";string SSEL="false";
if(PSA1>Open[i+1]&&PSA2
if(PSA1Open[i])SSEL="true";
if(((MAFilter==false)


(MAFilter&&MAFIB=="true"))&&SBUY=="true"&&TIFI=="false"){if(Reverse)SV=1;else BV=1;break;}
if(((MAFilter==false)
(MAFilter&&MAFIS=="true"))&&SSEL=="true"&&TIFI=="false"){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{Lots=MathFloor((AccountFreeMargin()*AccountLeverage()*Risk*Point*100)/(Ask*MarketInfo(Symbol(),MODE_LOTSIZE)*MarketInfo(Symbol(),MODE_MINLOT)))*MarketInfo(Symbol(),MODE_MINLOT);}}


if(MM==false){Lots=Lots;}
if(Balance!=0.0&&Martingale==True){if(Balance>AccountBalance())Lots=Multiplier*Lots;else if((Balance+MinProfit)=AccountBalance()&&Balance<=AccountBalance())Lots=Lots;}Balance=AccountBalance();


// expert init positions
int cnt=0,OP=0,OS=0,OB=0,CS=0,CB=0;OP=0;for(cnt=0;cnt
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)
(PSA3Open[i]&&!(PSA1>Open[i+1]&&PSA2
(TIFI=="true")
(EnableRealSL&&(OrderOpenPrice()-Bid)/Point>=RealSL)
(EnableRealTP&&(Ask-OrderOpenPrice())/Point>=RealTP)){CB=1;}
if((BV>0)
(PSA3>Open[i+1]&&PSA4Open[i]))
(TIFI=="true")
(EnableRealSL&&(Ask-OrderOpenPrice())/Point>=RealSL)
(EnableRealTP&&(OrderOpenPrice()-Bid)/Point>=RealTP)){CS=1;}
for(cnt=0;cnt


if(OrderType()==OP_BUY&&OrderSymbol()==Symbol()&&((OrderMagicNumber()==Magic)
Magic==0)){if(CB==1){OrderClose(OrderTicket(),OrderLots(),Bid,Slip,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()&&AddPositions&&OP<=MaxOrders)
(OP==0&&!AddPositions)){
if(OS==0&&OB==0){Comment("no order opened");}
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,Lots,Bid,Slip,SLI,TPI,OrSt,Magic,0,Red);OS=0;Comment("sell order opened","\n","magic number : ",Magic);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,Lots,Ask,Slip,SLI,TPI,OrSt,Magic,0,Lime);OB=0;Comment("buy order opened","\n","magic number : ",Magic);return(0);}}
for(j=0;j
Magic==0)){TrP();}}}return(0);}


// expert number of orders
int CntO(int Type,int Magic){int _CntO;_CntO=0;
for(int j=0;j
Magic==0))_CntO++;}}return(_CntO);}


//expert breakeven
void TrP(){double pb,pa,pp;pp=MarketInfo(OrderSymbol(),MODE_POINT);if(OrderType()==OP_BUY){pb=MarketInfo(OrderSymbol(),MODE_BID);
if(BE>0){if((pb-OrderOpenPrice())>BE*pp){if((OrderStopLoss()-OrderOpenPrice())<0){ModSL(OrderOpenPrice()+0*pp);}}}


// expert trailing stop
if(TS>0){if((pb-OrderOpenPrice())>TS*pp){if(OrderStopLoss()
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+TSStep-1)*pp
OrderStopLoss()==0){ModSL(pa+TS*pp);return;}}}}}


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


//expert add positions function
bool AddP(){int _num=0; int _ot=0;
for (int j=0;j
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);
if(TK<0){if (GetLastError()==134){err=1;Print("NOT ENOGUGHT MONEY!!");}return (-1);}}

0 comments

Post a Comment

Related Posts with Thumbnails
Traffic Generator - Drive 33000 Hits a Day to your Website!
Build a Highway and drive
33,000 Hits a Day to your Website !

First, check out the sites in the box below. These are member sites which has participated in the program and can testify that this program truly works ! By visiting these sites, you will see why this program will work for you as well.

PARTICIPATING SITES - Visit them Today !

  1. Rencah kehidupan Merangkumi Nasihat, Petua, Resipi di samping berhibur dengan memuat turun lagu diki
  2. Menjual dan promosi alat-alat serta ubatan untuk lelaki sejati
  3. Make Money From Your Phone
  4. Malaysia Community Website with information on pubs, restaurants & businesses in Bangsar
  5. Webportal.com.my - Your Malaysian Portal
  6. Free Utilities, Tools and Scripts - XGEN Technologies


INSTRUCTIONS on how to get at least 33,000 Hits a day!

  • When you sign up, you will receive your own page just like this one. It will have your link and its description in position #1.In position #2 will be the link that is now in position #1 on this page. All other links are moved down as well and the one in #6 is dropped.

  • When people visit your page and sign up, they too will get a new page. And your link will be copied onto their page. Their page will have their link in position #1 and your link in position #2. And when people come to the pages created by the people who came to your page, your link goes to position #3, etc..


  • Of course the next step is to get visitors to your new "33,000 Hits a day" page. As a result, we recommend that you utilise our Auto URL Submission program to submit your Website Address to major search engines.

  • To prove that this program works, lets do some very conservative mathematics and assume that once your page is installed and promoted you only generates a total of 20 sign ups.
    Pages with your link!
    1. 20 people visit your page and get their own page 20
    2. These 20 pages each produce 20 sign ups producing 20 x 20 pages = 400 pages 400
    3. These 400 pages each produce 20 sign ups each, producing 400 x 20 = 8000 pages 8000
    4. These 8000 pages each produce 15 sign ups producing 8000 x 20 = 160,000 pages 160,000
    5. These 160,000 pages each produce 20 sign ups producing 160,000 x 20 = 3,200,000 pages 3,200,000
    Total pages with your link: 3,368,420


    Of these 3,368,420 pages with your link we will assume 1% of their visitors will actually click on your link and visit your page. That's 33,684 hits a day!. Additionally every page is generated by our script which means that the rotation and placement of your link is 100% accurate and cannot be removed or dropped prior to its natural demise.

    Sign up simply consist of your URL and your web site description..Your page will be generated immediately and then you can go on to our installation and free promotional pages.

    You should also appreciate the fact that there is no upper limit to the number of hits you can get, because you can keep your page for as long as you want and it in turn will generate more than the stipulated signup figure of 20.

    Also, after you have installed your page, there is no more work involved. Just let this system run by itself and it will give you 33,000 hits a day or more.

    Good Luck and make sure you place your generated page at a visible and easy to reach area so that people can join and make this program work!


    Please be sure to visit the above links before you sign up!!

    Ready?.. Go for it!! there is nothing to lose and fantastic traffic to gain!
    Enter your web site URL:

    Enter your web site description: (This must represent your website in 100 characters)




    XGEN Technologies - Banner Advertisement Program

    Copyrights © XGEN Technologies Sdn Bhd. All rights reserved.

    Amanda Beauty Store

    All About Iklan

    ........................

    ........................

    make money with your web site

    ........................

    ........................

    ........................

    ........................

    ........................

    All Malaysian Bloggers Project

    ........................

    ........................

    put your add here for RM 0.25/day

    (125x125)

    ........................

    put your add here for RM 0.25/day

    (125x125)

    msg me @ azrulahmad@yahoo dot com dot my for asking about my add

    ........................


    koleksi cerpen & novel

    ........................


    Joint GiffarineKL Groups

    nuffnang

    Archives

    Rencah Kehidupan

    My Twitter

    Twitter Value

    Ada sesiapa yang berminat nak beli?RM 10,362.34Your website value?

    Locations of visitors to this page Online Nutrition Degree - Courses & Training

    Followers

    mybloglog