Fill/Kill Time Extension

Advanced automation available in Guardian - Chat with others and share files here.
Post Reply
User avatar
flavenge
Posts: 13
Joined: Mon Aug 24, 2020 5:25 pm

I'm trying to adapt Dallas's scalping bot for pre-match football trading.
I want to place bets in advance of kick off - sometimes several days before a match starts. I'm using the fill/kill function to ensure that my offset bet is not triggered until after the initial bet is placed. However, the issue I have is that if my initial bet is not matched it is canceled after 99999 seconds - which seems to be the longest time in which the fill/kill function stays live. Is there any way of extending that fill/kill time period above 99999 seconds? If the bet is canceled after 99999 seconds, could I use a condition to immediately place the bet again(?) - although I appreciate that that solution isn't ideal as I would lose my place in the bet queue. Thank you.
User avatar
Dallas
Posts: 23596
Joined: Sun Aug 09, 2015 10:57 pm

The time can't be extended so the only other way to do this is to create another rule to place the offset bet

On your original back/lay bet you can use the stored value tab and store the price the bet is placed at with an adjustment of plus/minus 'X' ticks

Then on the second rule which places the opposing bet you can set that to place at 'Stored Value Price'
Or if it was offset bet with greening you were doing, use a 'Close trade with greening' rule but still have it placed at 'Stored Value Price'

You'll need to use some additional conditions like your probably already using like number of matched bet, number of unmatched bets, matched bets amounts etc to control when each rule is able to trigger
User avatar
flavenge
Posts: 13
Joined: Mon Aug 24, 2020 5:25 pm

Thanks, Dallas. I'm relatively new to this, so I'll have a crack at it and I'll come back if I have any more questions.
User avatar
Dallas
Posts: 23596
Joined: Sun Aug 09, 2015 10:57 pm

flavenge wrote:
Thu Aug 31, 2023 10:56 am
Thanks, Dallas. I'm relatively new to this, so I'll have a crack at it and I'll come back if I have any more questions.
Sure no probs, if needed you could upload the file with how far you've got and i'll take a look
User avatar
flavenge
Posts: 13
Joined: Mon Aug 24, 2020 5:25 pm

Hi again Dallas
Thanks for your kind offer. So as not to waste your time and in the hope of being able to solve this puzzle myself, I'm trying (without much success) to create the equivalent of 'offset batches'. I know that I need to use the Stored Values with (probably(!)) the 'Matched Bet information of a selection' but I can't work out how to make the whole thing work perfectly.

To take a step back, the following is basically what I'm trying to achieve (I will fiddle with the number of ticks etc later) -
1. I want to place a lay bet 1 tick below the current best market price.
2. Once that has been placed, I want to place a back bet 2 ticks above the matched lay bet price. This can trigger in batches if the whole of the back bet is not yet matched.
3. I want to place a stop/loss 2 ticks below the matched lay bet price. This can also trigger in batches if the whole of the lay bet is not matched.
4. I want to green up whenever the back bet (in whole or in batches) is matched, and also to green everything say 1 minute prior to kick off.
I'm happy to share what I've done so far, but if you can give me a few pointers I'll keep trying before I share the baf.
Thank you again.
User avatar
Dallas
Posts: 23596
Joined: Sun Aug 09, 2015 10:57 pm

flavenge wrote:
Fri Sep 01, 2023 11:56 am
Hi again Dallas
Thanks for your kind offer. So as not to waste your time and in the hope of being able to solve this puzzle myself, I'm trying (without much success) to create the equivalent of 'offset batches'. I know that I need to use the Stored Values with (probably(!)) the 'Matched Bet information of a selection' but I can't work out how to make the whole thing work perfectly.

To take a step back, the following is basically what I'm trying to achieve (I will fiddle with the number of ticks etc later) -
1. I want to place a lay bet 1 tick below the current best market price.
2. Once that has been placed, I want to place a back bet 2 ticks above the matched lay bet price. This can trigger in batches if the whole of the back bet is not yet matched.
3. I want to place a stop/loss 2 ticks below the matched lay bet price. This can also trigger in batches if the whole of the lay bet is not matched.
4. I want to green up whenever the back bet (in whole or in batches) is matched, and also to green everything say 1 minute prior to kick off.
I'm happy to share what I've done so far, but if you can give me a few pointers I'll keep trying before I share the baf.
Thank you again.
Having a rule to place the opposing set in batches will require several stored values to be set up, ie, it will need to store the total the total amount you want to have matched (ie, the stake your opening bet is going to place)
It'll then constantly need to store another value using the total amount minus the amount now matched.

I'd get it set up working so that once its fully matched the offset be triggers, then once that's done add the 'batches' to it
User avatar
flavenge
Posts: 13
Joined: Mon Aug 24, 2020 5:25 pm

Dallas

I've been given some help but my contact has hit a brick wall. Below is his latest message, and I also attach the file that he has created. I'm hoping that you might be able to suggest a route forward -

I have attached the script so far, you can see it is a complicated beastie. I developed using the Overs selection in an Under/Over 2.5 Goals market. No biggie to move to Match Odds though.
Stake and odds are entered in the first rule, not via the Parameters tab, so I can calculate the Back stakes and price.
Rule 2 is a countdown clock to kick off
Rule 3 is a simple lay bet
Rule 4 Stored Values is where I begin to derail:
How can I calculate whether the lay bet has been fully matched or not?
You can see I have been toying with the idea of using Net Stakes, but this would include Back and Green-Up stakes and therefore can't be the figure I am looking for.
Unmatched Bet information only helps if the bet is 100% unmatched and the bet is the last one placed; the last bet placed may be a Back or Green-Up bet
Matched Bet Information includes matched and partially matched bets and the bet is the last one placed; the last bet placed may be a Back or Green-Up bet
Seconds to KO is an attempt to cancel and resubmit bets after 24 hours so that the initial lay does not time out
Cancel the lay bet if only partially matched
See above for issues about how to calculate the unmatched part of the lay bet
Resubmit the lay using the unmatched component as the stake
Same issue here.
So I assumed that the initial bet would be a Friday and therefore day 2 a Saturday, day 3 a Sunday and day 4 a Monday. The above process where the partially matched lay bet is cancelled and resubmitted is replicated for each of those days.
I opted for 16 back bet batches. These are all controlled by the number of hours since the lay bet was placed.
I may need to stop the back bet from firing if the lay bet is only partially matched. I thought using Back Bets Matches < Lay Bets Matched would do it but then it dawned on me that a green-up bet would skew this formula and back bets would not trigger correctly. This is another consequence of not being able to calculate how much of the initial lay bet has been matched.
The actual placing of the back bet is not a problem.
Having realised this morning that there is a fundamental issue with my approach I have not gone on to code the rules for the green-up bets. They would follow along similar lines to the back bets though.

Where do we go from here? I am stumped unless I get a flash of inspiration on how to determine whether the initial lay bet is fully or partially matched, and if the latter, how much remains unmatched. Feel free to add this code to your forum post. Dallas may be able to help. What I'd really like to do is recover bet data using the bet identifier, that would solve the problem but I don't think this is possible, unfortunately.

Regards
You do not have the required permissions to view the files attached to this post.
User avatar
Dallas
Posts: 23596
Joined: Sun Aug 09, 2015 10:57 pm

There looks like there's around 50 rules in that file and unfortunately I don't have the time to unpick and debug a file of that complexity

If you want to upload a striped down version with just the two rules I advised in my earlier post then if you can't get that working I'll take a look

Then once that is working you can merge them files into your full strategy
Post Reply

Return to “Bet Angel - Automation”