Disliked{quote} can you explain modifygap please and whats the difference with the changed risk code and to the addspreadtosl as it already had?Ignored
If you've ever looked in the logs, you can see the EA struggling to straddle current price. The reason it struggles is that even a price change of only 0.00001 will make the EA try to modify both Pending Orders to 'centralize' them/. The modify process takes 1-2 seconds but price can change several times per second. So the idea with ModifyGap if you set it to say 10 is that if price changes by upto 1 pip, the pending orders aren't modified. But as soon as you go over 1 pip, it will modify them. So if the sell price of EURUSD is 1.30, and your sell stop is at 1.29950, the sell price has to change to 1.29989 before the sell order is modified to 1.29939.
Before the EA would adjust for tiny price movements, sometimes even less than 1 point (1/10th pip). The advantage is that when price really moves the EA is ready to modify it.
The risk code never used to take into account Stop Loss distance. Obviously the further your stop, the more you are risking. A little while ago I added a calculation that means if you set your SL twice as far it will only trade half the amount of lots. But this calculation didn't include the spread, so wasn't a true reflection of what you might lose if stopped out. There is an option to not include the spread in any of the SL calculations (AddSpreadToSL=false.) So as long as AddSpreadToSL is true, the risk code now works out your maximum risk based on the SL distance with the MaxSpread setting added on, whereas before it was just SL distance. It isn't perfect because it can't take into account Slippage, but it's a lot better than before.
Hope that helps
Alan