Are Rules fired in a linear order?

Advanced automation available in Guardian - Chat with others and share files here.
Post Reply
User avatar
Brovashift
Posts: 475
Joined: Tue May 18, 2021 12:35 am

Hi all,

I have create a servant to place a lay bet and once matched place 2 offset bets @1 and 2 ticks below the context price. This works fine, but I wanted to do the same things for a back bet, using the same servant so I could sign it to 1 mouse button click based on where my pointer was, back or lay side of the ladder.

So I have been trying out Signals this morning with the idea that I could set a signal for the lay stake = true when placed into the market, and condition for the back stake that looks for a signal from the for the lay stake to = false. And visa versa.

Signals
LAYED = true (dont place back stake)
LAYED = false (can place back stake)
BACKED = true (dont place lay stake)
BACKED = false (can place lay stake)

Am I correct in thinking that these rules are fired in a linear order? Because it seems, based on the market logs that my initial "Place lay stake" rule is always fired first and so its signal value is always set. How else could I achieve this? Is there a way to group rules together?
Im thinking like if I was using and if else statement I'd do something like;

if else (placeLayStake = true)
{
Run this code;
}
else
{
Run this code;
}

TIA
You do not have the required permissions to view the files attached to this post.
User avatar
Dallas
Posts: 22713
Joined: Sun Aug 09, 2015 10:57 pm
Location: Working From Home

Rules are always checked in order each time the market is refreshed so if a rule needs a signal or stored value to be set then that rule should be somewhere below the rule that sets the signal or stored value, otherwise it wont trigger until the next market refresh
User avatar
Brovashift
Posts: 475
Joined: Tue May 18, 2021 12:35 am

Dallas wrote:
Tue Aug 02, 2022 1:10 pm
Rules are always checked in order each time the market is refreshed so if a rule needs a signal or stored value to be set then that rule should be somewhere below the rule that sets the signal or stored value, otherwise it wont trigger until the next market refresh
You've pickled my brain Dallas :lol:

If my 'place lay stake' rule needs to check my 'place back stake' rule, and visa vesa, then surely one of those will always be second to the first, meaning which ever one is first will always fire and the second never will... Is the problem that both my Place Stake rules are relying on each other, and so maybe if I hold the signal status in a separate Stored Value rule, it can be place above the (place stake) rule that needs to use it? :idea: :?:
User avatar
Dallas
Posts: 22713
Joined: Sun Aug 09, 2015 10:57 pm
Location: Working From Home

Brovashift wrote:
Tue Aug 02, 2022 2:08 pm
Dallas wrote:
Tue Aug 02, 2022 1:10 pm
Rules are always checked in order each time the market is refreshed so if a rule needs a signal or stored value to be set then that rule should be somewhere below the rule that sets the signal or stored value, otherwise it wont trigger until the next market refresh
You've pickled my brain Dallas :lol:

If my 'place lay stake' rule needs to check my 'place back stake' rule, and visa vesa, then surely one of those will always be second to the first, meaning which ever one is first will always fire and the second never will... Is the problem that both my Place Stake rules are relying on each other, and so maybe if I hold the signal status in a separate Stored Value rule, it can be place above the (place stake) rule that needs to use it? :idea: :?:
The way your rules appear to be set up means the lay bet is always checked first and will be able to trigger if its conditions are met (that will then stop the back bet triggering)

The back bet rule could only trigger IF the lay bet hasn't

So there'd have to be unmatched back bets on the selection when the servant is started in order for the lay bet rule not to be able to trigger and the back bet rule having the chance to
Post Reply

Return to “Bet Angel - Automation”