Set market refresh rates automatically through a trigger
Description
This is a "How-to" example with two simple triggers to set market refresh rates programmatically. Sometimes it is important to speed up or slow down a market's refresh rate. E.g. you might want to make it refresh faster towards the start of event. There are special settings in the program for defining the refresh rate of In-Play and non-In-Play markets, but they don't cover all possible cases.
The first trigger in the file will set the refresh rate for each market according to the values you will specify in the constants. Read below how to adjust the constants.
The second trigger checks the number of monitored markets in My Markets every 30 seconds, then sets the refresh rate to the number of markets being monitored multiplied by a given multiplier.
For example:
- If there are 5 markets being refreshed and multiplier is 2, then set the Idle refresh rate to 5 x 2 seconds = 10 seconds
- If there are 3 markets being refreshed and multiplier is 0.5, then set the In-Play refresh rate to 3 x 0.5 seconds = 1.5 seconds
The refresh rates are automatically adjusted according to the number of markets.
Another reason why you might want to regulate the refresh rate is the data request limit imposed on all BetFaur users. If you are refreshing many markets at the same time, it makes sense to reduce individual refresh rates to prevent huge queues for market data, as MarketFeeder Pro will automatically limit your requests to prevent charges.
Triggers
One of the triggers is disabled - choose the one you want to use and disable the other.
Use the following constants to adjust your triggers:
- irr - Idle refresh rate in seconds
- iprr - In-play refresh rate in seconds
- irrx - Multiplier for Idle refresh rate. If irrx = 2, then with 5 refreshing markets the Idle rate will be 2*5 = 10 sec.