Jump to content
  • 0

OrderSend error 131


FXBarom

Question

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

Link to comment

3 answers to this question

Recommended Posts

  • 0
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

Link to comment
  • 0

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
Link to comment

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
  • General Statistics

    • Total Topics
      22,996
    • Total Posts
      95,333
    • Total Members
      43,611
    • Most Online
      7,522
      10/06/21 10:53

    Newest Member
    max50
    Joined 25/09/23 08:48
  • Posts

    • Zscaler Inc., Elliott Wave Technical Analysis Zscaler Inc., (ZS:NASDAQ): Daily Chart, 25 September 23 ZS Stock Market Analysis: We have been monitoring this stock as we were mainly looking for continuation higher after what seemed to be an initial move to the upside followed by a corrective downward move. At this stage the main scenarios are two. Either we just made wave (i) of {c} and we are looking to resume higher or else we’ve had a short wave {c} and we could be continuing lower.   ZS Elliott Wave Count: Wave (ii) of {c}. ZS Technical Indicators: 20EMA as support.   ZS Trading Strategy: Looking for longs into wave (iii). TradingLounge Analyst: Alessio Barretta Source : Tradinglounge.com get trial here!         Zscaler Inc., ZS: 4-hour Chart, 25 September 23 Zscaler Inc.,Elliott Wave Technical Analysis ZS Stock Market Analysis: Looking for a potential three wave move into wave (ii) to then have additional confirmation of upside resumption. We currently stand at the 50% retracement, with invalidation below wave (i).   ZS Elliott Wave count:  Wave (ii) of {c}. ZS Technical Indicators: Between averages. ZS Trading Strategy: Looking for longs after upside confirmation.
    • WD Gann Said over 100 years ago "When TIME & PRICE BALANCE, the trend HAS to change" . Yes, there is a definite maths relationship, Via Gann or Elliot-waves. The pity is I cannot get Gann Angles on IG as they are not properly defined as per Gann, and do NOT REMAIN FIXED AT THOSE ANGLES WHEN YOU CHANGE TO ANY TIMEFRAME!!!!!!!! Even the Gann fan angles, used by all brokers, are a joke. These angles are not set arbitrarily as the system allows, and no means to measure angles!!!!  
    • Making money through trading involves analyzing markets & making informed decisions. One buys assets at low prices & sells them high.To break it down, traders study charts, news, and economic indicators to spot potential opportunities. They use technical analysis to identify patterns and trends and fundamental analysis to assess the health of a market. Timing is key – traders aim to enter and exit positions at the right moments to maximize profit.Also, there are some tips on how to make money fast – they're out there, and they work. But remember, trading isn't a guaranteed shortcut to quick cash. It takes discipline, risk management, and continuous learning.
×
×
  • Create New...
us