OrderSend question

 

Hello All,

I'm using Interbank FX demo account and just testing the OrderSend() function.

I created a new Expert Advisors and under start() I have place the following code

if(Bars != bars)

{

bars = Bars;

int ticket;

ticket=OrderSend("GBPUSD",OP_BUY,20,Ask,3,Ask-25*Point,Ask+2*Point,"My order#1",16384,0,Yellow);

}

Now is this correct? And if it is, how can I make sure the order went through ok or not?

When I look at Trade tab in Interbank fx, I don't see anything?

Thanks

kam

 

I believe a minimum distance of 10 pips is required for stops and take profit orders.

 

But I have 25 pip diff in here.

Also the value of ticket is return -1 and GetLastError() show error code 4109 which means ERR_TRADE_NOT_ALLOWED.

Anyidea?

Thanks

kam

 

Your TP is "Ask+2*Point". Also, why don't you try with a lot size of 1 instead of 20? There maybe a limitation on the number of lots.

If you are mini account on IBFX, the symbol has an "m" appended to it.

 

that was a typo on my part (Ask +2*point)

ok this is what I have now

ticket=OrderSend("mGBPUSD",OP_BUY,2,Ask,1,Ask-10*Point,Ask+10*Point,NULL,0,0,CLR_NONE);

Still ticket returns -1

and GetLastError() shows error code 4109 which means ERR_TRADE_NOT_ALLOWED.

Can you please send a sample so I can copy and paste to my program to see if is working or not?

Thanks again

 

I think the "m" comes at the end of the currency

GBPUSDm