how to add spread limit (protection) to ea? EA must open trade only when spread is 2-7 pips but sometimes it goes up to 12 on some pairs.
Buy Stop Limit and Sell Stop Limit Orders on MT4 6 replies
Auto SL/TP & buy limit, sell limit/buy stop, sell stop EA/indi 2 replies
Difference between buy limit, sell limit, buy stop, & sell stop? 4 replies
Drag&Drop buy limit and sell limit scripts 1 reply
Can someone fill my limit order even if price doesn't hit the specified limit? 5 replies
Dislikedhow to add spread limit (protection) to ea? EA must open trade only when spread is 2-7 pips but sometimes it goes up to 12 on some pairs.Ignored
DislikedI think the ordersend function has the slippage value through which you will be able to control the trade. So set it to 7 and if the spread is above 7 the trade is not placed.
Experts, correct me if I am wrong please.Ignored
DislikedSlipage will not be affected by spread. What slipage is used for is to allow the order to go through at a different price without having to requote.
eg. you send an order through at a price of 1.2834 but before the server can process your order the price changes to 1.2836. Without slipage you would get an error back saying that the price is wrong and you would need to code around this to resubmit the order at the new price (and potentially have the same problem again and again if the market is currently moving so fast).
What slippage does is allow...Ignored