by BFDon » Fri Apr 28, 2017 2:42 pm
I'm looking to cancel all lay or back bets for a given market that i'm logging in excel. I use the COM interface mostly but as far as I know there's only the cancelAllBets function to cancel multiple bets which cancels both the back and the lays rather than one or the other. I've tried looping through mybets and then using cancelBet function for each back/lay but this is quite slow. If I have 10 unmatched back bets for instance the time between cancelling the first bet and the last can be a couple of seconds.
So I turned to the cancel triggers which appeared to suit what I needed. If I only have bets on one selection CANCEL-ALL-LAY and CANCEL-ALL-BACK work fine. However if I have Back or Lays across multiple selections that I want to cancel then I have issues. For instance if I have back bets across 5 selections then I run a macro to populate cells Q5:Q9 with CANCEL-ALL-BACK (and something in each of the BetRef cells) . Upon the next gruss refresh the triggers fire and cancel the bets but they do it one selection by one so it takes a while. At the bottom of BA you it cycling through each selection cancelling the bets 'Last Action: Cancelled all bets for selection..' and you can see them disappear from the market in turn. This can take a few seconds to complete if I have bets across a number of selections.
This is different to the way other triggers function like 'BACK' or 'LAY' where even with lots of selections all the triggers/bets fire exactly the same time
Is there any way to make the cancels happen together rather than one after the other so there's no lag? I guess what i'm after is a trigger similar to the way 'CANCEL-ALL-MARKET' works except 'CANCEL-ALL-LAY-MARKET' and ''CANCEL-ALL-BACK-MARKET'
Thanks