NEED HELP!!!

 

How to send an order?

I use this EA to indicate me if the current value is above or below a ceratin level:

int start()

{

double

Level_1,

Level_2,

Price;

Level_1=1.28337;

Level_2=1.28337;

Price=Bid;

//-------------------------------------------------------------------+

if(Price>Level_1)

{

Alert("en haut");

}

//-------------------------------------------------------------------+

if(Price<Level_2)

{

Alert("en bas");

}

//-------------------------------------------------------------------+

return(0);

}

Now what I want to do is to place an order when it is above:

int start()

{

double

Level_1,

Level_2,

Price;

Level_1=1.28300;

Level_2=1.28300;

Price=Bid;

//-------------------------------------------------------------------+

if(Price>Level_1)

{

Alert("en haut");

OrderSend("EURUSD",OP_BUY,1,Bid,2,Bid-5*Point,Bid+5*Point);

}

//-------------------------------------------------------------------+

if(Price<Level_2)

{

Alert("en bas");

}

//-------------------------------------------------------------------+

return(0);

}

But it doesn't work, all it does is informing me if it's above or below, it doesn't place the order as it should.

Can somebody help me with this?

How can I place an order?

 

The first few things...

1) A Buy wouldnt normally succeed at the Bid price, especially with tight Slippage - try the Ask price

2) Stop levels are almost certainly too close to the order price, especially of this is a sub-pip account

3) If this is sub-pip then Slippage is too tight

4) Is the 'pair name' correct for the broker?

Much of this would be narrowed down by looking in the Experts and Journal tab for error numbers and looking here https://docs.mql4.com/constants/errors for what they mean...

-BB-

 

//-------------------------------------------------------------------+

if(Price>Level_1)

{

Alert("en haut");

OrderSend("EURUSD",OP_BUY,1,Bid,2,Bid-5*Point,Bid+5*Point);

}

//-------------------------------------------------------------------+

//-------------------------------------------------------------------+

if(Price>Level_1)

{

Alert("en haut");

OrderSend(Symbol(), OP_BUY, Lots, BID, 0, 0, 0, "Test", 230710, 0);

OrderModify(OrderTicket(), OrderOpenPrice(), OrderOpenPrice()-StopLoss*Point, OrderOpenPrice()+TakeProfit*Point, 0); }

}

//-------------------------------------------------------------------+

 
BarrowBoy:

The first few things...

1) A Buy wouldnt normally succeed at the Bid price, especially with tight Slippage - try the Ask price

2) Stop levels are almost certainly too close to the order price, especially of this is a sub-pip account

3) If this is sub-pip then Slippage is too tight

4) Is the 'pair name' correct for the broker?

Much of this would be narrowed down by looking in the Experts and Journal tab for error numbers and looking here https://docs.mql4.com/constants/errors for what they mean...

-BB-


Can you post an Buy Order?

So that I can see how it's done and ajust it to my values.

Reason: