I'm have serious lag issues, for example this routine from a simple cancel bet to place bet takes about 1 second. The code is as follows
| TriggerStatus.CancelLayTrade ->
status <- TriggerStatus.PlaceLayTrade
let tradeUnmatchedL = _selection.Bets |> getUnmatchedBetsByBetType BetType.Lay
TriggerResult.CancelBets (Some tradeUnmatchedL, onBetsCancelledBack)
| TriggerStatus.PlaceLayTrade ->
status <- TriggerStatus.Initialize
let stake = defaultArg (botTriggerParameters.GetParameter<float>("Stake")) 2.0
let bet = [ SelectionBetOrder.Create(_selection, BetType.Lay,selection.ToLay.FirstBestPrice.Price, stake)]
TriggerResult.PlaceBets (bet, PersistenceType.Lapse, onBetsPlaced)
Is there a problem with this code?
Basically is it possible to "mirror" a position if it changes rapidly, eg the toLay first position is moving away from our bet so we want to cancel/move our bet to stay at first position.