Having Trouble Placing Orders..Weird error

 

Hi! Here is my entry function. Before I've added RefreshRates(), it didn't place any orders and did not show any errors..Now that I've added RefreshRates,it shows "OrderSend Error 130" although the SL and TP are 0 as you can see.

:D
Please Advice,thank you.
 
t0mbfunk:

Hi! Here is my entry function. Before I've added RefreshRates(), it didn't place any orders and did not show any errors..Now that I've added RefreshRates,it shows "OrderSend Error 130" although the SL and TP are 0 as you can see.

Please Advice,thank you.

Why aren't you testing the OrderSend() return value to check for errors ? don't you want to know when they fail and what the relevant variables are when they do fail ? for example, Bid, Ask, LotSize, sleve1, magic, etc

Read this: What are Function return values ? How do I use them ?

Why are you checking that your trading parameters are valid according to this: Requirements and Limitations in Making Trades ?

 

Well as I said I did that and it gives me error 130..I do not know what to do with it..

In error description it gives "Invalid stops"..no more than that..

Reason: