Announcement

Collapse
No announcement yet.

(Req.) straddle script for news

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • (Req.) straddle script for news

    Please someone can share a straddle script that SELL stop and BUY stop inmediate!


    I try this but don't work anymore!

    Code:
    http://www.mirrorcreator.com/files/OVJDOHWW/Straddle_EA_Immediate.mq4_links

    ------------------------------------------------------------
    others
    http://www.medi@fire.com/file/j2zyit...%20EA%201a.mq4

    http://www.medi@fire.com/file/ommjjj...xpert_v1.1.mq4

    http://www.medi@fire.com/file/ne0myy...dle_Script.mq4

    http://www.medi@fire.com/file/dmjf4j...traddle_EA.mq4

    http://www.medi@fire.com/file/iwomw4...e%20Script.ex4

    http://www.medi@fire.com/file/dyzmmdz4jhz/Straddle.ex4

    Thanks

  • #2
    Re: (Req.) straddle script for news

    Try This..
    put on script folder
    Code:
    #property copyright "Copyright ? 2008, Tri Noviantoro"
    #property link      "mailto:trintoro@gmail.com"
    
    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");
    }

    Comment


    • #3
      Re: (Req.) straddle script for news

      Thanks I'll try!

      Comment


      • #4
        Re: (Req.) straddle script for news

        Be carefull, This Script has over limit order for entry . This script need protection for single entry.

        Comment

        Top Active Users

        Collapse

        There are no top active users.
        Working...
        X