HELP! Error 130: 5 digits switched broke a perfectly working robot

 

Hi,

My broker just recently switched to a new "core" technology, whatever that is, and along the changes came a 5 digits switch. The problem is that now my OderSend() function is broken and every time gets an error 130. I've tried everything, from normalizing takeprofit and stoploss to sending the order with no takeprofit nor stoploss, and nothing. The stupid error keeps popping up. I really am stuck here, any help would be very much appreciated. Note: the broker is IBFX and before the change everything worked like a charm.

Here is the structure of my OrderSend() function:

OrderSend(Symbol(),
OP_BUY,
10.0,//volume
Ask,
3,//slippage
NormalizeDouble(stoploss,Digits),
NormalizeDouble(takeprofit,Digits),
"",//comment
0,//magic
0,//expiration
CLR_NONE);

 

What did IBFX support tell you to do?

 
robotalfa:

Hi,

My broker just recently switched to a new "core" technology, whatever that is, and along the changes came a 5 digits switch. The problem is that now my OderSend() function is broken and every time gets an error 130. I've tried everything, from normalizing takeprofit and stoploss to sending the order with no takeprofit nor stoploss, and nothing. The stupid error keeps popping up. I really am stuck here, any help would be very much appreciated. Note: the broker is IBFX and before the change everything worked like a charm.

Here is the structure of my OrderSend() function:

OrderSend(Symbol(),
OP_BUY,
10.0,//volume
Ask,
3,//slippage
NormalizeDouble(stoploss,Digits),
NormalizeDouble(takeprofit,Digits),
"",//comment
0,//magic
0,//expiration
CLR_NONE);



Have you check your parameters ?

with 4 digits, you had for ex. param1 = 40 and with 5 it has to be 400.

 
1005phillip:

What did IBFX support tell you to do?



Haven't asked yet. The code still works fine on my life account but is broken on demo. Life servers will migrate on July 17. I'm afraid it will break the code on life accounts too.

P.S. this started to happened late last night

 
Matutin:


Have you check your parameters ?

with 4 digits, you had for ex. param1 = 40 and with 5 it has to be 400.



That's what NormalizeDouble() does.
 
robotalfa:


That's what NormalizeDouble() does.


NormalizeDouble() does the good digits number, but not if StopLoss is far away from Ask. Do you check the minimum spread distance and if stoploss is less than Ask.

Have you print Ask, spread and stoploss to check ?

 
Matutin:


NormalizeDouble() does the good digits number, but not if StopLoss is far away from Ask. Do you check the minimum spread distance and if stoploss is less than Ask.

Have you print Ask, spread and stoploss to check ?



I'll check!

p.s. I did check and still nothing.

 
robotalfa:


I'll check!

p.s. I did check and still nothing.


what are the printing values ?
 
robotalfa:


I'll check!

p.s. I did check and still nothing.


Here you go big pimpin! The PIPOINT function finds the value of the pip no matter what. This can be used for any currency pair. Everything else in this code, I put in here is to help you understand the usage of it. LET ME KNOW THIS WORKS FOR YOU!

int init()
  {
//----
   usepoint = pippoint(Symbol());
   useslippage = getslippage(Symbol(), slippage);
//----
  }

int start()
{
   buyticket = OrderSend( Symbol(), OP_BUY, lotsize, Ask, useslippage, 10,
                     Bid + (30 * usepoint), "Buy Order", NULL, 0, Green);

//Pip Point Function
double pippoint(string currency)
   {
      int calcdigits = MarketInfo(currency,MODE_DIGITS);
      if(calcdigits == 2 || calcdigits == 3) double calcpoint = 0.01;
      else if(calcdigits == 4 || calcdigits == 5) calcpoint = 0.0001;
      return(calcpoint);
   }

//Get Slippage Function
int getslippage(string currency, int slippagepips)
   {
      int calcdigits = MarketInfo(currency,MODE_DIGITS);
      if(calcdigits == 2 || calcdigits == 4) double calcslippage = slippagepips;
      else if(calcdigits == 3 || calcdigits == 5) calcslippage = slippagepips * 10;
      return(calcslippage);
   }
 
 
Matutin:

what are the printing values ?


For USDJPY is 87.655... for EURUSD is 1.2578... obviously in the first one is giving the correct value but the order is not working. For the EURUSD is normalizing only up to 4 digits, not 5.


I have to say that I tried the function with stoploss and takeprofit both equal to 0.00000 and the order did work in the EURUSD pair.

 
RJKool:


Here you go big pimpin! The PIPOINT function finds the value of the pip no matter what. This can be used for any currency pair. Everything else in this code, I put in here is to help you understand the usage of it. LET ME KNOW THIS WORKS FOR YOU!



I'll give it a try...thanks!

Reason: