OrderSend generates 131 error Invalid trade volume

Back to topics list To post a new topic, please log in or register
avatar
77
brad 2015.10.12 09:46
 

Hi there,

 I'm using this code to open a couple pending orders and get the error as in subject.

extern double SLDistance=.0020;
double Lots=0.01;//MODE_MINLOT/Digits;
double LongEntry;
double ShortEntry;

 

LongTicket=OrderSend("EURUSD",OP_BUYSTOP,Lots,LongEntry,3,LongEntry-SLDistance,0,"",1);

      if(LongTicket<0)
        {
         Print("Unable to create pending long order: ",GetLastError());
        }

      ShortTicket=OrderSend("EURUSD",OP_SELLSTOP,Lots,ShortEntry,3,ShortEntry+SLDistance,0,"",1);

      if(ShortTicket<0)
        {
         Print("Unable to create pending short order: ",GetLastError());
        }

 I've read about MODE_MINILOT which is 23 according to the print out.

I've called the broker and they've confirmed their min lot size is 0.01.

Can you please advise? 


 

avatar
1109
Ovo 2015.10.12 09:57 #
 
If you refer to the back-testing, then update to build 891.
Back to topics list  

To add comments, please log in or register