Jump to content

(Req.) straddle script for news


cazador

Recommended Posts

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

Link to comment
Share on other sites

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");
}

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...