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
  • image.png

  • Posts

    • The mischievous amphibian who became a meme legend? Well, meet Apu, his wide-eyed, optimistic cousin, taking the internet by storm – and now, perhaps, the world of finance. Apu, also known as Peepo or Helper, is a kinder, gentler Pepe variant. Tired of the often-scammy memecoin scene, Apu (or rather, Apu's devoted community) decided to create something different: $APU, a "fairly launched, fully transparent coin" built by and for "all frens." Here's where things get interesting. $APU's narrative is one of resilience and community power. Fueled by the cryptocurrency community's enthusiasm, $APU was initially launched with the best of intentions. However, the dream took a nasty turn when the original developer pulled the rug – a disheartening scenario for many crypto enthusiasts. Today, $APU stands as a testament to community empowerment. It's a beacon of hope for projects facing similar challenges, a reminder that collaboration and resilience can transform setbacks into stepping stones. It's also worth noting that another community-driven memecoin, $MASSA, recently found a home on the Bitget exchange. Could this be a sign of things to come for $APU? What are your thoughts? Does Apu's story inspire you? Can a memecoin truly become a legitimate force in the volatile world of cryptocurrency? Share your thoughts and predictions in the comments below!
    • The price shown on the graph is the price after the IG's fee taken. That is the reason for discrepancy.
    • I am a relatively newbie. I have seen similar and also have seen automated closed position has a loss though the close price I have set was above the price I have bought. After about 6 months with a lot of mysterious losses though my closing price was above the opening price, I discovered this was because of the amount charged for opening/closing a position. This is right below BUY and SELL boxes on the right in very small font. This amount vary from  0.9 to 33 or more depending on the level of trading at the time you open or close. It also happens (god knows why it is set to be so, except that the trader is not watching) when there is a lot of buying and selling going on, like an important news has suddenly been out and the result was not the market expected. As a result, I delete all my automated BUY/SELL values before I stop trading for the day. Remember, the the software is set up to favor the IG, not the retail seller. That is why 70% or more end up in loss.  
×
×
  • Create New...
us