Stop Loss tick by tick
Posted in Bot programming by Mir.
LAY bet 30.00 EUR matched at 2,94. BACK bet 30.00 EUR placed at 3,05. Market going against me.
My idea is: When the conditions of StopLoss are met, move bets "tick by tick" every 2500* miliseconds. In several steps, not in one huge StopLoss step as usual. (* for example)

I would like to see how can I prepare bot (or part of code). Thanks.
Wednesday, March 31, 2010
C# source code for betfair bot
To program such betfair bot functionally you can reuse the bot PlaceBetBot to place your opening bet and then override DoYourJob method to add required features for your trading bot. First you have to realize through which states your bot will go, after the PlaceBetBot bot places its opening bet and signals that your opening bet is fully matched, so your bot can continue with trading.
So what are those states?
You can write following C# code:
public override void DoYourJob() { base.DoYourJob(); if (betPlaced) { switch (tradingState) { case TradingState.WaitingForTrade: ClosePositionForProfit(); break; case TradingState.BackingInProgress: case TradingState.LayingInProgress: if (GetCanUpdateClosePosition()) { UpdateClosePosition(); } break; case TradingState.BackingBetDone: case TradingState.LayingBetDone: StopBot(); break; default: break; } } }Your bot uses all parameters of the PlaceBetBot, and the trading part of your bot uses following three parameters:
Your bot class name is:
Bfexplorer.Scripting.PlaceBetClosePostionStopLossTickByTickBot
Use it with the Bot Executor and MyBot settings. I have included this betfair bot script to the latest version of Bfexplorer PRO so you will find the source code file in the MyBots folder. Install the latest version of Bfexplorer PRO.
Monday, April 05, 2010
This is exactly what I wanted. Thanks again.