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

    • Ever feel like you're stuck in crypto traffic? Slow transactions and outrageous fees are the bane of using blockchains like Ethereum at their core (Layer 1). These networks can only handle a limited number of transactions per second, causing major congestion during peak hours. The result? Frustratingly slow processing and expensive fees for users.   But wait, there's hope! Layer 3 rollups are here to revolutionize the game. Imagine them as express lanes built on top of existing bypass roads (Layer 2 solutions). Layer 2 already helps by alleviating some of the traffic on the main highway (Layer 1). Layer 3 rollups take it a step further, adding dedicated express lanes to these bypass roads for super-fast processing. This innovative approach tackles Layer 1's congestion by distributing the workload across multiple layers, ultimately leading to faster, cheaper, and more scalable blockchain applications.   While specific layer 3 implementations are still under development, some projects are paving the way. Immutable X (IMX token) built on StarkNet (a Layer 2 scaling solution) and dYdX (DYDX token), a decentralized exchange on StarkNet, are both exploring layer 3 rollups to achieve even smoother transactions. Keep an eye out for zkLink Nova, a major player in the scalability game. This cutting-edge technology leverages the strengths of existing solutions to deliver groundbreaking performance. Backed by leading crypto institutions with over $23 million invested in the zkLink ecosystem, zkLink Nova is generating serious buzz ahead of its ZKL token listing on Bitget. Get ready for a smoother ride on the crypto highway!
    • Well, I didn't mine $PIXFI but I was able to make good profit from Bitget Poolx. 
    • This partnership further shows Bitget continuous passion for massive crypto adoption 
×
×
  • Create New...
us