cazador Posted March 16, 2010 Report Posted March 16, 2010 Please someone can share a straddle script that SELL stop and BUY stop inmediate! I try this but don't work anymore! :-?? http://www.mirrorcreator.com/files/OVJDOHWW/Straddle_EA_Immediate.mq4_links ------------------------------------------------------------ others http://[email protected]/file/j2zyitzob55/WSS%20News%20EA%201a.mq4 http://[email protected]/file/ommjjjjjwnv/TimeBreakExpert_v1.1.mq4 http://[email protected]/file/ne0myyjmynq/Straddle_Script.mq4 http://[email protected]/file/dmjf4jlmhkw/Straddle_EA.mq4 http://[email protected]/file/iwomw4jwdmm/Burger%20Straddle%20Script.ex4 http://[email protected]/file/dyzmmdz4jhz/Straddle.ex4 Thanks
tongtoro Posted March 17, 2010 Report Posted March 17, 2010 Re: (Req.) straddle script for news Try This.. put on script folder #property copyright "Copyright ? 2008, Tri Noviantoro" #property link "mailto:[email protected]" extern double distance = 50; extern double stoploss = 25; extern double takeprofit = 60; extern double lots = 0.02; int start() { int ticket; string hcomment = "Berita"; ticket=OpenPendingOrder(OP_SELLSTOP,lots,distance,5,stoploss,takeprofit,hcomment); if(ticket>0) { if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES)) Print("Pending " + GetOrderType(OrderType()) + " order opened : ",OrderOpenPrice()); } else Print("Error opening Pending " + GetOrderType(OrderType()) + " order : ",GetLastError()); ticket=OpenPendingOrder(OP_BUYSTOP,lots,distance,5,stoploss,takeprofit,hcomment); if(ticket>0) { if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES)) Print("Pending " + GetOrderType(OrderType()) + " order opened : ",OrderOpenPrice()); } else Print("Error opening Pending " + GetOrderType(OrderType()) + " order : ",GetLastError()); return(0); } //+------------------------------------------------------------------+ int OpenPendingOrder(int pType=OP_BUYLIMIT,double pLots=1,double pLevel=5,int sp=0, double sl=0,double tp=0,string pComment="",int pMagic=123,datetime pExpiration=0,color pColor=Yellow) { switch (pType) { case OP_BUYLIMIT: return(OrderSend(Symbol(),OP_BUYLIMIT,pLots,Ask-pLevel*Point,sp,(Ask-pLevel*Point)-sl*Point,(Ask-pLevel*Point)+tp*Point,pComment,pMagic,pExpiration,pColor)); break; case OP_BUYSTOP: return(OrderSend(Symbol(),OP_BUYSTOP,pLots,Ask+pLevel*Point,sp,(Ask+pLevel*Point)-sl*Point,(Ask+pLevel*Point)+tp*Point,pComment,pMagic,pExpiration,pColor)); break; case OP_SELLLIMIT: return(OrderSend(Symbol(),OP_SELLLIMIT,pLots,Bid+pLevel*Point,sp,(Bid+pLevel*Point)+sl*Point,(Bid+pLevel*Point)-tp*Point,pComment,pMagic,pExpiration,pColor)); break; case OP_SELLSTOP: return(OrderSend(Symbol(),OP_SELLSTOP,pLots,Bid-pLevel*Point,sp,(Bid-pLevel*Point)+sl*Point,(Bid-pLevel*Point)-tp*Point,pComment,pMagic,pExpiration,pColor)); break; } } string GetOrderType( int type) { if(type == OP_BUY) return ("Buying position"); if(type == OP_SELL) return ("Selling position"); if(type == OP_BUYLIMIT) return ("Buy Limit pending position"); if(type == OP_BUYSTOP) return ("Buy Stop pending position"); if(type == OP_SELLLIMIT) return ("Sell Limit pending position"); if(type == OP_SELLSTOP) return ("Sell Stop pending position"); }
cazador Posted March 17, 2010 Author Report Posted March 17, 2010 Re: (Req.) straddle script for news Thanks I'll try! :-bd
forex4love Posted March 17, 2010 Report Posted March 17, 2010 Re: (Req.) straddle script for news Be carefull, This Script has over limit order for entry . This script need protection for single entry.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now