by Gavin » Sun Jan 18, 2015 10:23 pm
Hi Alan,
The greening was considered but I have left it up to the user to manually click to green up all the robots bets in one click after stopping the robot for example just before the off. I'll try to explain the login behind this decision:
If one side of the pair of robot bets has been matched (e.g. the back), then the other unmatched side bet (eg the lay) might have to be moved to scratch or to act as a stop loss. If the position always had to be a perfectly balanced green (or balanced red) then both the stake and price would have to change when the second bet is moved to scratch or act as the stop loss. Betfair do not allow us to change both the stake and the price of a bet simulataneously in one request, so to do it would require the robot to request the cancellation of the bet, thenwait for confirmation that it was cancelled and had not been matched, then issue the new bet at the new stake and price. So it is massively faster to simply move the existing bet to the new location without having to change the stake or wait for the confirmation of a cancel request, thus requiring just one request.
As speed is so important to the chances of getting a profit, or not missing a scratch or stop loss, this was the way I felt it had to be done.
Kind regards,
Gavin