My ordersend() command cant open any order

 
Dear members,

Can any one please help me. my program cannot open any order. This is the first time I am using this command. I keep getting the error message "Invalid_Price_ Param"

which is error 4107. Can anyone tell me what I am doing wrong. Thank You.


int TN = OrderSend(Symbol(),OP_BUY,1,Bid,5,Bid-25,Bid+40, NULL,0,0,CLR_NONE);
 
upchair:
Dear members,

Can any one please help me. my program cannot open any order. This is the first time I am using this command. I keep getting the error message "Invalid_Price_ Param"

which is error 4107. Can anyone tell me what I am doing wrong. Thank You.


int TN = OrderSend(Symbol(),OP_BUY,1,Bid,5,Bid-25,Bid+40, NULL,0,0,CLR_NONE);



You can't buy the Bid. Substitute Ask

 
Also Bid-25 is invalid, you want Bid - 25 pips = Bid-25*Point. On a 5 digit broker a Point is NOT a pip. Adjust your slippage and limits:
//++++ 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; }
Reason: