this is related to my other question
https://community.welldonesoft.com/marketfeeder-troubleshooting/check-for-market-name-in-file/msg52047/#msg52047The idea is that I place a lay bet on the favourite, using certain conditions, and if it wins, that's the end. If the horse wins, then I need to use loss recovery on the next qualifying race to get back my loss (100%) and also place the stake value.
I currently have a simple constant called _add which contains the amount lost, and this is used in the back amount formula
as (bank_size * perc_bet) + (_add/0.95)
Ideally, I would really like to be able to detect if the horse won or lost, and then have something in the trigger(s) to either stop at the winning bet, or increase the next bet amount according to the formula above. It has a maximum of 3 losing bets and if that's reached, I write off my losses.
I suspect this would be easy to do if I didn't have other strategies running, but I do have a number of them running, and so detecting the win amount or loss amount may not be related to that specific race of that strategy, so I am a bit stuck on how to do this.
in a nutshell, here is what I am trying to achieve
1. Lay the favourite, using the market_id condition, and odds > _some_odds, lay amount = (bank_size * perc_bet) + (_add/0.95)
2. if horse loses, stop
3. If horse wins, then add losses to the _add variable (constant)
4. Lay the favourite, using the market_id condition, and odds > _some_odds, lay amount = (bank_size * perc_bet) + (_add/0.95)
5. if horse loses, stop
6. If horse wins, then add losses to the existing _add variable (constant)
7. no matter what, this is the 3rd race, so no more betting after this (there will only be 3 market_id's anyway), if it wins, then write off losses
I want the trigger to use the following conditions...
check for minutes before off to be between low_toff and high_toff
market_id in file (.....)
Rank = 1
odds greater than or equal to _low
the conditions can only be based on the specific horse that is bet on, and detecting whether it has won or lost, and then taking the action, as above. I may have other strategies that are using this horse for betting, and it may even be that it places a back bet - so, in effect, for this strategy, I am looking to see if this horse won or lost its race, then take appropriate action.
I want the _add value updated on a losing race, and I want the following formula used to place the next bet...
(bank_size * perc_bet) + (_add/0.95)
which is effectively the normal stake amount to win plus the loss, accounting for commission.
I would like the constants to be as follows
<constants>
<const name="bank_size" value="100.00" descr="bank Size" saveValue="0"/>
<const name="perc_bet" value="0.0125" descr="percentage bet" saveValue="0"/>
<const name="low_toff" value="4.7" descr="4.7minutes before the off" saveValue="0"/>
<const name="high_toff" value="5" descr="5 minutes before the off" saveValue="0"/>
<const name="_add" value="0" descr="Loss amount" saveValue="0"/>
<const name="_low" value="3.5" descr="Odds value" saveValue="0"/>
</constants>
perhaps _add may not be needed as it may require initial setup via some other way that does not require a constants value?
and I would prefer to keep the names I have used.
I am attaching my trigger, which does the simple job of placing the lay bet based on the above, but without the loss recovery. If you can adjust this, then fine.
FYI, I put this together from a strategy I learned about which uses the 3rd, 5th and 8th races of the day (including Irish), and has had some good success, and that's why you will see _358 in the constants....
Thanks
Mark.