From Market Feeder forum:
My lay strategy involves waiting for 2 losses, before actually betting.
Where is the option to do this. I want a losing run of 2 before I actually bet money, but cant find a trigger or a betting option anywhere.
Any help appreciated.
I was looking for some bot trigger tutorial that would help Peter to program his horse racing bot trigger.
I do not want to implement exact specification as it could be no use for others, therefore I took this use case scenario from Market Feeder forum, mainly when even on MF forum no one suggested solution.
What is interesting on this request?
The bot trigger actually check winner of the race/bet event, not the result of your betting, because no bet was placed. One user on MF forum replied, but certainly he did not understand what user actually asked for.
Here is my bot trigger code: ReportWinner.fsx
On the line 24 it is registered our strategy using the bot name. This allows us to execute the same trigger on different strategies, and so all results are then group by strategy name.
On the line 40, it is checked whether strategy can be executed, because strategy can be executed only when previous result is known.
On the line 42 the current market is added to myStrategyResults. Why the market must be added?
Bfexplorer must know which markets should be checked after they are closed and settled for results.
On the line 45 myStrategyResults.SettledMarkets are evaluated, in the context of this bot trigger, we take just last settled market, and report the winner and his last price traded.
I tested the bot trigger on greyhounds markets, executing the bot trigger by Bot Executor, and as in the Output view bot reports all kind of message, I added “Winner:” text when reporting results (lines 29 - 32), so I could filter out just lines with “Winner:” text.
At the end of my short video I showed the bot trigger code, and what you can see when programming, after typing: myStrategyResults, and type .
The IntelliSense in Visual Studio show all available public methods or properties of myStrategyResults object.
There you can see TotalProfit, TotalProfitInStreak, TotalWinningBets, TotalLosingBets and BettingStreak, so properties we can use when programming any bot strategy that requires previous results.
In this tutorial, as no bets were placed on markets (not even in the practice mode), the only usable properties are CanExecuteMyStrategy and SettledMarkets.