Jump to content
  • 0

OrderSend error 131


FXBarom

Question

Posted

My MT4 trading system that works normally with other MT4 brokers always fails in IG Forex Metatrader 4 tester with "invalid trade volume" error.

OrderSend SELL error: invalid trade volume, P=1.1282, Bid=1.1282, SL=1.1302, TP=0.0000, Lot=0.1

I have tried to set a lot size to 0.1, 1, 10 - no difference, the same error occurs.

Also, I've found that IG MT4 server does not return valid values for the lots info:

The following MQL4 code:

 Print("MODE_MINLOT= ", MarketInfo(Symbol(), MODE_MINLOT));
 Print("MODE_LOTSTEP= ", MarketInfo(Symbol(), MODE_LOTSTEP));
 Print("MODE_MAXLOT= ", MarketInfo(Symbol(), MODE_MAXLOT));

returns zeroes for all three values

 

aezonemt4.png

3 answers to this question

Recommended Posts

  • 0
Posted
12 hours ago, FXBarom said:

My MT4 trading system that works normally with other MT4 brokers always fails in IG Forex Metatrader 4 tester with "invalid trade volume" error.

OrderSend SELL error: invalid trade volume, P=1.1282, Bid=1.1282, SL=1.1302, TP=0.0000, Lot=0.1

I have tried to set a lot size to 0.1, 1, 10 - no difference, the same error occurs.

Also, I've found that IG MT4 server does not return valid values for the lots info:

The following MQL4 code:

 Print("MODE_MINLOT= ", MarketInfo(Symbol(), MODE_MINLOT));
 Print("MODE_LOTSTEP= ", MarketInfo(Symbol(), MODE_LOTSTEP));
 Print("MODE_MAXLOT= ", MarketInfo(Symbol(), MODE_MAXLOT));

returns zeroes for all three values

 

aezonemt4.png

Hi @FXBarom,

Please reach out to helpesk.us@ig.com with your account details and information above. Our team will be able to investigate and come back to you with a solution.

All the best - Arvin

  • 0
Posted (edited)

Thank you, I will, but don't know why account details are relevant if it fails in MT4 Strategy Tester that has absolutely independent settings, in particular allows to set a spread, balance, etc. that have nothing to do with real market and account type.

I'm aware about 2-step order brokers and tried both approaches.

=============

   if (type== OP_SELL ) {
       P= Bid;

      //TP= OP- PipToPrc(OC);

       if (TakeProfit> 0) {
           TP = P- PipToPrc(TakeProfit);
       } else
           TP= 0;


       P= NormFXPrice(P); TP= NormFXPrice(TP); SL= NormFXPrice(SL);

       if (TwoStepOrder) {
           T= OrderSend( Symbol(), OP_SELL, LotSize, P, 3, 0, 0);//, OrdComm, MagicNumber, 0, SellColor);

           Sleep(DELAY);

         if (T< 1) {
            PrintOrderError(T, "2-step OrderSend error ", GetLastError(), P, Bid, 0, 0);
         } else {
            if ( !OrderModify(T, OrderOpenPrice(), SL, TP, SellColor) )
               PrintOrderError(T, "OrderModify error ", GetLastError(), P, Bid, SL, TP);
        }

       } else {
          T= OrderSend( Symbol(), OP_SELL, LotSize, P, 3, SL, TP);
          if (T< 1)
           Print("OrderSend SELL error: "+ ErrorDescription(GetLastError())+ ", P="+ PrcToStr(P)+ ", Bid="+ PrcToStr(Bid)+ ", SL="+ PrcToStr(SL)+ ", "+"TP="+ PrcToStr(TP)+ ", Lot="+ LotSize);
      }
   }

 

Edited by FXBarom

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • image.png

  • Posts

    • Stock Market Indices Overview: S&P 500, SPY, NASDAQ 100, QQQ, RUSSELL 2000, DAX 40, FTSE 100, ASX 200. Featuring Elliott Wave Technical Analysis Elliott Wave Technical Analysis and Trading Strategies: S&P 500, NASDAQ 100, RUSSELL 2000, DAX 40, FTSE 100, ASX 200. Indices look forward to higher levels in this short term bullish run. Elliott Wave Analysis SP500 (SPX): Wave i of (v) of iii) of 5 of (5) of 3) NASDAQ 100 (NDX) Wave i of (v) of iii) of 5 of (5) of 3) Russell 2000 (RUT) IWM ETF: Wave b) of 4 DAX 40 (DAX): Wave iii of (v) of iii) of 5 of (5) of 3) FTSE 100 UKX (UK100) Wave i) of 5 S&P/ASX 200 (XJO): Wave i of (v) of iii) Financial Events Core PPI m/m US Unemployment Claims AUD Employment Change EUR Monetary Policy Statement Video Chapters Comprehensive Elliott Wave analysis for major indices:  00:00 SP 500 (SPX) 10:48 NASDAQ 100 (NDX) 17:22 Russell 2000 (RUT) IWM ETF 18:08 DAX 40 (DAX) 20:12 FTSE 100 UKX (UK100) 23:28 S&P/ASX 200 (XJO) 31:02 End Analyst Peter Mathers TradingLounge Source: tradinglounge com  Over 200 Markets, Access 7 Analysts in Chat Rooms, AI & Algo Elliott Wave Charting, Trade Portfolios & More..  
    • Decentralization is getting more popular and that is the real reason why the crypto and Blockchain ecosystem was developed in the first place, and we keep seeing new Dex trading project coming up with advanced features.  Decentralized trading has started gaining attention recently,and with a good reason. Decentralized exchanges are rapidly providing advantages against centralized exchanges, such as more leverage, onchain order books, tighter spreads, and a more engaging trading experience. One platform that stands out in this arena is Hyperliquid, which has caught my interest because of its unique approach to decentralized perpetual trading.   One of the most notable aspects of Hyperliquid is its focus on providing a seamless decentralized perpetual exchange service. The platform facilitates perpetual futures trading directly on its native L1 blockchain, which sets it apart from other DEXs. What makes Hyperliquid even more attractive is its elimination of gas fees for transactions. This feature drastically reduces the cost barrier for traders, making it a more accessible platform. Moreover, this gas-free model contributes to enhanced transaction speed and efficiency, delivering a smoother and faster trading experience.   Given these advantages, I’ve decided to keep a close eye on Hyperliquid’s native token, HYPE, especially as it’s now available for farming on the BingX Xpool. Participating in token farming not only supports the ecosystem but can also be a rewarding way to earn while engaging with this cutting edge DEX platform.   This is also another way of putting idle assets to work like BTC and USDT, as holders are holding BTC and waiting for it to rise to make more profits or holding USDT in preparation to buy newly found tokens, you can stake these assets on BingX XPool and share 150,000 HYPE tokens effortlessly. This is a good way to earn HYPE tokens before it hits the exchange spot market. Sign up on BingX to join the XPool Here    
    • When I first heard about $MOVE, I didn’t think much of it. Let’s face it—there’s always another “hyped” coin making the rounds. But something interesting around this token made me curious enough to take a second look. People were raving about its Ethereum Layer 2 scalability and lightning-fast 30k TPS. The technology seemed solid.   After reading more about $MOVE and its potential, I looked into Bitget pre-market. At a price of just $0.538, it seemed like a calculated risk worth taking. When the token was officially listed, the price shot up, and those early gains got a good return. That said, crypto is a risky game, and I always remind myself not to get swept up in the hype.   For every win, there’s a chance of loss, and that’s why staying informed and investing only what you can afford to lose is crucial. Still, experiences like this keep me excited about exploring new opportunities. Whether it’s $MOVE or the next big thing, doing your research, staying engaged, and being cautious can make all the difference!
×
×
  • Create New...
us