Condition Needed - Money waiting on the ladder 'X' ticks away

Advanced automation available in Guardian - Chat with others and share files here.
Post Reply
CallumPerry
Posts: 575
Joined: Wed Apr 19, 2017 5:12 pm

I have a signal called 'Start trading', among other criteria, i'd like the signal to turn true if there are no gaps on the ladder. Thinking about it, i'll probably need two different rules depending whether i'm backing or laying so, if i'm just backing:

If the LTP is 4.0, I only want a BACK bet to be placed on the condition that:
There is LAY money at: 4.1 AND 4.2 AND 4.3.

Any help please? :)
eatyourgreens
Posts: 282
Joined: Sun Feb 18, 2018 12:53 am

Hi Callum,

I have done a rules file for you, .......only U.S. racing around right now so I have not tested it much (tried a few races and it seemed ok) so test in practice mode first!.

It should set a signal called "backok" if there is lay money available at ltp +1tick, ltp+2ticks and ltp+3 ticks, and there is no gap between back and lay prices, if the signal becomes set with a value, it will cancel if any of the above become false, and set again if all become true.

It should set a signal called "layok" if there is back money available at ltp -1tick, ltp-2ticks and ltp-3 ticks, and there is no gap between back and lay prices, if the signal becomes set with a value, it will cancel if any of the above become false, and set again if all become true. rinse, wash repeat!

It is currently set to the favourite and will refresh every second for the last five minutes of a market before "off" time. (all easily adjustable)

Hope it works,
hope it helps,
stay safe!
Have a nice day! :-)


PS, there are no rules for placing any trades, it is just for setting the above signals with a value.
3above 3below for callum.baf
You do not have the required permissions to view the files attached to this post.
CallumPerry
Posts: 575
Joined: Wed Apr 19, 2017 5:12 pm

Thank you eatyourgreens!

I thought I’d have a look at the rules before responding here. Using the ‘The Money available to Lay at a price for a selection’ and using a stored value for the price is exactly what I need for my bot!

Thank you for your help.
CallumPerry
Posts: 575
Joined: Wed Apr 19, 2017 5:12 pm

One more thing, i'm embarrassed to say I have kept myself in the Excel world for far too long and not ventured into automation nearly as much as I should have in the past 12 months.

If i'm looking to condense rules down to tidy up, is there any reason why I can't squeeze those 12 stored values down into 1? If I store a value to run upon every refresh on the fav, unlimited triggers etc and I go across to the stored values tab...

Could I write all 12 stored values in this section here so all 12 belong to the one row on rules? I'm hoping this is the case and you just wrote it as 12 different rules so it was easy for me to grasp? Has anybody found any problems with doing it this way or is this quite common practice?
eatyourgreens
Posts: 282
Joined: Sun Feb 18, 2018 12:53 am

Hi Callum,
I am far from an automation expert, but I dont think those stored values can be put into one rule..........but I will stand to be corrected by my elders! (although I am an old git!)

You are right in your assumption that I did it the way I did in the hope that it would easier for you to grasp. However, I do know of a way of doing virtually the same thing using "history lists" in stored values tab, and using pre set choices like ""2nd best available price" in the stored values tab. I will explain why I did not use the latter in the previous file I posted. .............you required (when backing) money to be available at ltp +1 +2 and +3
and I assumed the reverse when laying, and for there to be no gaps in the ladder.
So, lets say the back price is 4, and the lay price is 4.1 (ie, no gaps) .......using pre set choices from the stored values tab, I think they are called something like "best current lay price" and "2nd best lay price" and "3rd best lay price" may sometimes not give you ltp+1 +2 +3........It will if the ltp was 4, but not if the ltp was 4.1.........hope that all makes sense :-)
I will look into trying to do the same (ish) thing using history lists and post back a revised file with (hopefully) less stored value clutter.

Meanwhile, on revisiting the file I posted earlier, I think there maybe a very slight error in it.............In the "cancel signal" rules, (I think there are 6 conditions) 3 of which are "grouped" conditions, I think the condition outside the group, needs placing inside the group...........as it is now it will only cancel if there is a gap in the ladder AND money becomes unavailable at one of the prices of concern, if the "ladder gap" condition is placed inside the group, it should cancel if any of the conditions become untrue, (I think!)..............hope that all makes sense too!

Goodluck!
Im off to look at history lists :-)
eatyourgreens
Posts: 282
Joined: Sun Feb 18, 2018 12:53 am

Hi again Callum,

I had a look at using "history lists" to try and condense the use of stored values, but sorry to say I could not come up with a solution :-( ..........

I have done a revised rules file that has less sv's than the original, but, as mentioned earlier, it is using the "pre set" money available at best lay price, 2nd best lay price and 3rd best lay price, so there maybe a 1tick difference between last traded price........example using a back price of 4 and lay price of 4.1

if ltp was 4, the svs will be (money available) best lay price (4.1) 2ndbest (4.2) third best (4.3) all what you wanted.
but, if ltp was 4.1, svs will still be (money available) best lay price (4,1) 2nd best (4.2) third best (4.3), so it will not be ltp+3 ticks, but ltp+2 ticks.

Hard for a thicko like me to explain, but I hope it makes sense again!

The attached Mk2 has only been done for your "back" criteria, just reverse everything if you want a lay version. As you know the first version had 12 svs, 6 for back and 6 for lay, this version will have 3 for back and 3 for lay (at the expense of a 50/50 chance of being 1 tick away from what you wanted)
hope it helps,
3above 3below for callum mk2.baf
Goodluck, stay safe
have a nice day! :-)
(practice mode first!)
You do not have the required permissions to view the files attached to this post.
eatyourgreens
Posts: 282
Joined: Sun Feb 18, 2018 12:53 am

eatyourgreens wrote:
Sat Aug 21, 2021 1:12 am
Hi again Callum,

I had a look at using "history lists" to try and condense the use of stored values, but sorry to say I could not come up with a solution :-( ..........

I have done a revised rules file that has less sv's than the original, but, as mentioned earlier, it is using the "pre set" money available at best lay price, 2nd best lay price and 3rd best lay price, so there maybe a 1tick difference between last traded price........example using a back price of 4 and lay price of 4.1

if ltp was 4, the svs will be (money available) best lay price (4.1) 2ndbest (4.2) third best (4.3) all what you wanted.
but, if ltp was 4.1, svs will still be (money available) best lay price (4,1) 2nd best (4.2) third best (4.3), so it will not be ltp+3 ticks, but ltp+2 ticks.

Hard for a thicko like me to explain, but I hope it makes sense again!

The attached Mk2 has only been done for your "back" criteria, just reverse everything if you want a lay version. As you know the first version had 12 svs, 6 for back and 6 for lay, this version will have 3 for back and 3 for lay (at the expense of a 50/50 chance of being 1 tick away from what you wanted)
hope it helps,
3above 3below for callum mk2.baf
Goodluck, stay safe
have a nice day! :-)
(practice mode first!)
Hi,
I have been thinking about the mk2, and it is probably not going to be very useful. I have since realised that the 2nd best price and 3rd best price (with money available) could really be anywhere on the ladder, they could easily be many ticks away from the current best lay price, so please only test in practice mode.
sorry if I have misled you with this one! :-(

stay safe!
User avatar
Dabbla
Posts: 826
Joined: Wed Apr 15, 2009 1:50 pm

You could store a value for lay price +1 tick = LP1, then lay price + 2 tick = LP2 and so on.

You would then use those SV to check the money available.
Store a value for(Name) (MALP1) >
(with) (money available at lay price) >
(PRICE) (Help in another stored value) >
(Another SV holding the price) (other value name) = LP1

The above can be all done in one rule, including the backside .

You would then use MALP1 to test betting rules,
E.G. If, MALP1 = 0, then you have a gap.
CallumPerry
Posts: 575
Joined: Wed Apr 19, 2017 5:12 pm

Hey again eatyourgreens,

I had a look at your file and I can see what you mean. That was more or less my original dilemma with finding money available at specific prices, what you originally suggested does the trick. I was just wondering (for general future reference) if I could create one rule which stores several stored values at the same time? I’m a neat freak aha.

Following on from that,

Daddla, would it work if I stored LP1 and LP2 in the same rule as you described in your last message? I assume so. I’ll give what you suggest a try in the next few days when I revisit the opening triggers of my new idea.

Thank you both!
User avatar
Dabbla
Posts: 826
Joined: Wed Apr 15, 2009 1:50 pm

This file does what I described. It contains 3 rules but you could put all the SVs into 1 rule.
The file will scan the best back/lay price then the next 5 ticks.
(DATA) MONEY SCAN (FV).baf
You do not have the required permissions to view the files attached to this post.
eatyourgreens
Posts: 282
Joined: Sun Feb 18, 2018 12:53 am

Hi callum,
If you try Dabblas idea and get it working, please post back how, because at the moment I dont quite understand it so I would be interested myself for future ref.

Another thought about the 12 sv's in the original rules file, I think that can be compressed to 8 (4back and 4 lay) the condition "lay price = back price +1 , tests if there is a gap between back and lay prices, so, by default, if there is no gap between back and lay, there must be money available at those prices ...........so those sv's may not be needed ????
have a play and see what you come up with! :-)

good luck!
CallumPerry
Posts: 575
Joined: Wed Apr 19, 2017 5:12 pm

eatyourgreens wrote:
Sat Aug 21, 2021 7:46 pm
Hi callum,
If you try Dabblas idea and get it working, please post back how, because at the moment I dont quite understand it so I would be interested myself for future ref.
Will do! I'll also download your latest version at some point today and tomorrow and see what I can come up with. Only ever stuck to Excel up until about a year ago and i'm just now appreciating how much automation can do. Still much to learn!
User avatar
Dabbla
Posts: 826
Joined: Wed Apr 15, 2009 1:50 pm

eatyourgreens wrote:
Sat Aug 21, 2021 7:46 pm
If you try Dabblas idea and get it working, please post back how, because at the moment I dont quite understand it so I would be interested myself for future ref.
I have added a file, its at the bottom of the last page if you want to have a look.
CallumPerry
Posts: 575
Joined: Wed Apr 19, 2017 5:12 pm

eatyourgreens wrote:
Sat Aug 21, 2021 12:17 pm

Hi,
I have been thinking about the mk2, and it is probably not going to be very useful. I have since realised that the 2nd best price and 3rd best price (with money available) could really be anywhere on the ladder, they could easily be many ticks away from the current best lay price, so please only test in practice mode.
sorry if I have misled you with this one! :-(

stay safe!
I am finally at the stage with my bot where I'd like to revisit this and actually implement it soon. I have managed to condense the rules to two ([ON] and [OFF]) rules which I am happy to share but first, any thoughts on how to make sure there are no gaps?

Like eatyourgreens pointed out, the i.e. 3rd best lay price could be anywhere on the ladder. Any way of checking it is only three ticks away from the best lay price? The bot is on my other laptop so I can share what I have tomorrow but I was hoping somebody had an idea to check for the gap before I add it to the finished thing?
Vovsen
Posts: 107
Joined: Sat Nov 03, 2018 4:50 pm

CallumPerry wrote:
Tue Oct 05, 2021 9:57 pm
I am finally at the stage with my bot where I'd like to revisit this and actually implement it soon. I have managed to condense the rules to two ([ON] and [OFF]) rules which I am happy to share but first, any thoughts on how to make sure there are no gaps?

Like eatyourgreens pointed out, the i.e. 3rd best lay price could be anywhere on the ladder. Any way of checking it is only three ticks away from the best lay price? The bot is on my other laptop so I can share what I have tomorrow but I was hoping somebody had an idea to check for the gap before I add it to the finished thing?
Here is another 2 threads about this topic:

viewtopic.php?f=17&t=23650&p=266490#p266490

viewtopic.php?f=17&t=23747


In order to check that the 3rd best lay price is three ticks away from the best lay price, you would use same stored values approach as Dabbla, eatyourgreens or in those posts have been described.

Then conditions similar to these:

The Lay Price is equal to SV LayPrice+3 minus 3ticks
or/and
The SV LayPrice+3 is equal to Lay Price plus 3 ticks

And if you include conditions for money waiting at these prices, including LayPrice+1 and LayPrice+2, you can make sure there is no gap.

But it would be great if there was an easier way to check or measure the distance/gaps between Best, 2nd Best etc. - It has been suggested a couple of times in the past
Post Reply

Return to “Bet Angel - Automation”