SOS! EA cannot trade Oil (order send error 131)
Results 1 to 7 of 7

Thread: SOS! EA cannot trade Oil (order send error 131)

  1. #1
    Hello,

    just a little help here! please!

    My ea works fine on currencies but have difficulty with WTI.
    It simply repeat error 131 in backtesting without any obvious explanations!


    Void DoOpenOrders(int orderType,double price)

    //-------------
    if(! AllowEAOpenOrders) return(0);
    if(GetOrdersTotal(orderType)gt;0) return(0);
    if(! IsTradeAllowed()) return(0);
    //int SLpoint=k_SL*ATR;
    double lots=GetLots();
    string orderComment=DoubleToStr(lots,GetL());//#29992;#20110;#24179;#21322;#20179; =GetLots()
    //if(orderType==OP_BUY) price=Ask;
    //else if(orderType==OP_SELL) price=Bid;
    //---------
    int ticket=OrderSend(Symbol(),orderType,lots,Normalize Double(price,Digits),Slippage,0,0,,MagicNum,0,Gold );

    if(ticketgt;0)

    Printing (EA Open Order Succeed. Symbol() M Period());

    else Printing (Error opening order Err:,GetLastError());



    EA attached
    https://forexintuitive.com/attachmen...8194386128.mq4

  2. #2
    Quote Originally Posted by ;
    quote Make sure each of the lots inputs fit the normal format allowed by your broker. Generally it's different than Currency Market pairs.
    Could you pls. Show me the distinction?

  3. #3
    Could someone have a look I am really have no clue on it!

    Int ticket=OrderSend(Symbol(),orderType,lots,Normalize Double(price,Digits),Slippage,0,0,,MagicNum,0,Gold );

    WTI let 0.0X lot, it can not be the size problem...

  4. #4
    Quote Originally Posted by ;
    quote Make sure all the lots inputs fit the standard format permitted by your broker. Generally it is different than forex pairs.
    Oh I am sorry!

    My broke can't let 0.01 lot on WTI, my EA does not have any problem!

  5. #5
    Quote Originally Posted by ;
    could somebody take a look into this matter, I am really have no clue on it! Int ticket=OrderSend(Symbol(),orderType,lots,Normalize Double(price,Digits),Slippage,0,0,,MagicNum,0,Gold ); WTI let 0.0X lot, it can not be the size issue....
    Many brokers, with oil etc only allow lot sizes as multiples of eg. 0.25
    Assess whether this is actually the case or not

  6. #6
    Quote Originally Posted by ;
    quote Oh I am sorry! My broke can't allow 0.01 lot on WTI, my EA doesn't have any problem!
    That has been my purpose!

  7. #7
    Quote Originally Posted by ;
    Hi, A little help here! please! My ea works fine on currencies but have difficulty with WTI. It just repeat error 131 in backtesting with no obvious reasons! void DoOpenOrders(int orderType,double price) { //------------- if(! AllowEAOpenOrders) return(0); if(GetOrdersTotal(orderType)gt;0) return(0); if(! IsTradeAllowed()) return(0); //int SLpoint=k_SL*ATR; dual lots=GetLots(); string orderComment=DoubleToStr(lots,GetL());//#29992;#20110;#24179;#21322;#20179; =GetLots() //if(orderType==OP_BUY) price=Ask; //else if(orderType==OP_SELL) price=Bid;...
    Be sure all the lots inputs match the standard format allowed from your broker.

    Generally it is different than FX pairs.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
This website uses cookies
We use cookies to store session information to facilitate remembering your login information, to allow you to save website preferences, to personalise content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners more information