Waiting after a trigger has fired

Description

This example is about how to do things rather than an implementation of a strategy.

It explains how to do an action (e.g. place a bet), then wait for a fixed amount of time, then do something else (or the same thing again).

Triggers

Click here to download the trigger file.

There are two blocks in the file, of which one is disabled. You can have one of them enabled and the other one disabled at your own will, they are in fact two examples in one file.

The first block called "Executing one trigger after another" executes one trigger, called "Performing a trigger", then waits for 15 sec and executes the other one, called "Doing something else after time has passed". The secret is in the second action of the first trigger: it sets a variable named "timer" that remembers the time when the main action (i.e. the bet) was performed. The second trigger then checks if enough time has passed by verifying the condition (now_time-timer)/mf_second is equal or greater than waiting_time, where waiting_time is the constant holding the number of seconds to wait for.

The second block repeats the same trigger over and over, with the fixed interval of around 15 seconds. I'm saying "around" because the actual interval may vary due to the different time needed to refresh a market.

You can use this simple example in your own triggers, all you need is to adjust the primary actions and add more conditions that suit your strategy.

 

If you have not heard of BetFair yet or do not have an account, register today and get £20 free. Use the link below:
New customers only, bet up to €/£20 on the Exchange and if your first bet loses, we’ll refund you €/£20 in Cash. Bet must be placed in first 7 days of account opening. T&Cs apply.
Gamble responsibly! Always be aware that betting is NOT risk-free. You must be 18+ years old before you try gambling, but even as an adult, withhold from spending money in an ill-judged manner. Our company does not encourage you to prefer gambling over other meaningful activities. If gambling is affecting your life or the lives of people close to you, please contact GamCare
 
© 2005-2023 WellDone Creative Software. All rights reserved. Terms and conditions.
BetFair® and the BetFair Logo are registered trade marks of Flutter Entertainment plc. Gamble responsibly.