Getting Point as zero

 

Hi All,

I am new to MQL.

I was trying out OrderSend example from https://docs.mql4.com/trading/OrderSend. So, I try to execute the following OrderSend(Symbol(),OP_BUY,1,Ask,3,Ask-25*Point,Ask+25*Point,"My order #2",16384,0,Green);

My OrderSend fails with -130 error. There are two things I see here- irrespective of what value I put as stop loss I get the same error and when I try to print Alert("Point is ", Point); or Alert("StopLevel = ", MarketInfo(Symbol(), MODE_STOPLEVEL)); I get 0 printed in alert. I am using Version:4 Build:226 of MetaEditor.

Can someone please help?

Thanks

 

If broker is 5 digits price, try to change Point with Point*10

or

Use this code:

  int MYpoint=Point;
  ////////////////////////////////////
  if(Digits==5||Digits==3)
  {
  MYpoint=Point*10;
  }

Change Point with MYpoint!!

 

P

Print and Alert default to a max of 4 decimal places, so use DoubleToString to see the full value, as in

 Alert("Point is ", DoubleToStr(Point, Digits));

FWIW

-BB-

 
I
pannek:

If broker is 5 digits price, try to change Point with Point*10

or

Use this code:

Change Point with MYpoint!!

In my case MYpoint will be 0 as Point in my case is zero.
 
BarrowBoy:

P

Print and Alert default to a max of 4 decimal places, so use DoubleToString to see the full value, as in

FWIW

-BB-


How does this matter Point is 0

I tried Alert("Point is ", DoubleToStr(Point, Digits));

and I still get 0.

 

try to send the TP & SL Separately from the ordersend() & use OrderModify()

 

I have a simple program

double point = 0.00001;

int orderSendResult = OrderSend(Symbol(),OP_BUY,1,Ask,3,Ask-25*point,Ask+25*point,"My order #2",16384,0,Green);

and I get 130 errorCode. Please help

 
double point = 0.00001;
int orderSendResult = OrderSend(Symbol(),OP_BUY,1,Ask,3,0,0,"My order #2",16384,0,Green); 
if (orderSendResult > -1)
   {
   OrderModify(OrderTicket(), OrderOpenPrice(), Ask-250*point, Ask+250*point, 0, CLR_NONE);
   }   
 

Surely Point should be 0.00001 on a five digit broker for most pairs and 0.001 for JPY pairs ? and Digits should be 5 and 3 respectively ?

Is there something wrong with the broker setup if that is not the case ?

on my 4 digit broker Point = 0.0001 and digits =4 for pairs like EUR/USD

Point = 0.01 and digits = 2 on USD/JPY and gold

 

ECN: Try changing to orderSend with TP/SL=0 and then modify.

5Digit brokers: You must change TP/SL and slippage

//++++ These are adjusted for 5 digit brokers.
double  pips2points,    // slippage  3 pips    3=points    30=points
        pips2dbl;       // Stoploss 15 pips    0.0015      0.00150
int     Digits.pips;    // DoubleToStr(dbl/pips2dbl, Digits.pips)
int init(){
    if (Digits == 5 || Digits == 3){    // Adjust for five (5) digit brokers.
                pips2dbl    = Point*10; pips2points = 10;   Digits.pips = 1;
    } else {    pips2dbl    = Point;    pips2points =  1;   Digits.pips = 0; }
    // OrderSend(... Slippage.Pips * pips2points, Bid - StopLossPips * pips2dbl
On a 5 digit broker ask+25*point is 2.5 pips and brokers have a minimum (MarketInfo(Symbol(), MODE_STOPLEVEL = 3 pips on IBFX)
Reason: