OrderSend works for some brokers not others

 

Hi All

This OrderSend works fine for some brokers:

OrderSend("USDCAD",OP_BUY,1,Ask,3,Ask-SL*Point,Ask+target*Point,"50varL",123,0,Blue);

But using the tester with alpari I get two errors: OrderSend error 4051, Invalid Function Parameter Value, since I used Point I assume

that I do not need to Normalize SL and TP.

Also get Invalid lots amount for OrderSend, so I have set lots to a simple integer, this is in tester so there is $10,000 in the account and I

don't know of any other restriction that would generate this error message.

Thoughts, ideas, brilliant insights, or even the obvious solution?

Thanks

Keith

 

Are you sure you have your SL and TP right? if your stop loss is a price you don't need the Point constant.

ex:

Ask - 1.2343 is OK

or

Ask - (50 * Point) is OK

 
jmca wrote >>

Are you sure you have your SL and TP right? if your stop loss is a price you don't need the Point constant.

ex:

Ask - 1.2343 is OK

or

Ask - (50 * Point) is OK

Thanks for the thought, but they are right, external variables that are set differently for various pairs, in this case they are 110 and 325.

The EA worked fine on other platforms, simply copied and transferred to Alpari, compiled ran and got error messages from tester. I thought perhaps different number of digits after decimal but using Point should solve that.

The EA runs on an hourly chart and so far hasn't attempted to open a trade in real time so I don't know if this is a tester artifact or something more sinister.

thanks again

Keith

Reason: