Author Topic: Condition met for x time prior to trigger  (Read 1707 times)

Tags:
  • All members
  • Posts: 8
Condition met for x time prior to trigger
« on: 10 Oct 2022, 08:12 »
Morning,

Hope someone can help me, I'm trying to get this trigger to lay/back a horse that meets the conditions consistently for 5 seconds prior to triggering the lay/back bet.

e.g. horse in-play is 2nd  for 3 seconds don't place lay/back bet. But if in-play their rank has been 2nd for 5 seconds place back/lay.

  • Tim Vetrov
  • Administrator
  • Posts: 4875
  • Gender: Male
*
Re: Condition met for x time prior to trigger
« Reply #1 on: 10 Oct 2022, 10:43 »
Hello,

The "problem" is the software refreshes the market. So the only information it gets is periodically refreshes. So it misses any market changes between refreshes. If it's OK for you then you could save the last rank change time in a trigger variable and compare it with the current time.
Proud to be 🇺🇦
I'm happy to help Monday - Friday, 08:00-18:00 GMT
Буду рад помочь с понедельника по пятницу, 08:00-18:00 GMT

  • All members
  • Posts: 8
Re: Condition met for x time prior to trigger
« Reply #2 on: 10 Oct 2022, 13:38 »
Thanks Tim,

I wouldn't have a problem with that , are you able to help, maybe expound on how to do that? 😅

  • Moderator
  • Posts: 3606
*
Re: Condition met for x time prior to trigger
« Reply #3 on: 10 Oct 2022, 17:49 »
Hi
Here is a slight variation on Tim's suggestion, basically a timer.
First trigger starts a timer on 2nd fav plus any of your conditions for the selection
Second trigger backs or lays same selection if still 2nd fav after x seconds on the timer

TRIGGER 1
action: set user variable, name: timer, value: now_time, individually per selection
first matching selection
once per market
conditions:
selections rank is equal to 2
and....your conditions as to when to start timer etc.

TRIGGER 2
action: back or lay
first matching selection
once per market
conditions:
trigger TRIGGER 1 number of runs per selection is greater than 0
and selections trigger expression (now_time - timer) / mf_second is greater than x
and selections rank is equal to 2

where x is number of seconds from TRIGGER 1 selections rank must still be 2

as Tim says the rank could change back and forth during x seconds but if the selection rank is 2 after x seconds TRIGGER 2 will fire

ps. moved this topic from x-feeder to MFP

 
Please read the following disclaimer with regards to the information you may request and obtain on our forum. This specifically concerns trigger files and various instructions as to how to implement a strategy.

  • All members
  • Posts: 8
Re: Condition met for x time prior to trigger
« Reply #4 on: 12 Oct 2022, 14:38 »
Hi Mark,

Gave it a try but no success 😔.

I have attached some photos hoping it may help. I have set the variable as advised as well as add the condition to my trigger.

Any feedback?

  • All members
  • Posts: 8
Re: Condition met for x time prior to trigger
« Reply #5 on: 12 Oct 2022, 14:49 »
Hi Mark, 

Please ignore my previous post, 

Please see the attached images. Any recommendations as my loss distribution will not trigger. 

  • Moderator
  • Posts: 3606
*
Re: Condition met for x time prior to trigger
« Reply #6 on: 12 Oct 2022, 17:57 »
Hi
Please try attached trigger in test mode.

In the constants you can set:
selections rank to bet on
number of seconds for checking rank is the same before betting

In the conditions to activate the timer I have set it to 15 seconds since the off. You can modify to activate the timer with your own conditions.

The trigger will activate the timer on the named rank and will bet if the selection's rank is the same after the specified number of seconds.
Please read the following disclaimer with regards to the information you may request and obtain on our forum. This specifically concerns trigger files and various instructions as to how to implement a strategy.

  • All members
  • Posts: 8
Re: Condition met for x time prior to trigger
« Reply #7 on: 16 Oct 2022, 20:01 »
Hi Mark,

Once more thank you and the help has been greatly appreciated. So just to clarify the trigger does exactly what you state it would. But what I need is the trigger to count x seconds whenever the selection is in 1st place. 

So like below

Providing x = 7 seconds 

Index 2 goes inplay, now ranks 1 after x seconds, trigger.

Index 2 goes inplay, now ranks 1 after 5 seconds don't trigger

Index 2 goes inplay, ranks 1 for 3 seconds , then rank changes to 4 , then changes again to 1 for 7 seconds then trigger.

I need it to count down everytime the conditions are met before triggering. At the moment once the conditions are met the timer starts, and if the rank changes then goes back to rank 1 it triggers.

I hope this was clear. Thanks in advance, it's greatly appreciated.



 

  • Moderator
  • Posts: 3606
*
Re: Condition met for x time prior to trigger
« Reply #8 on: 17 Oct 2022, 07:31 »
Hi
It is possible to construct a trigger with a timer to do that, but it might easier to use a condition like in this topic.

Favourite's Trigger Expression back_price - pdif_0.033 is the minimum
is what is shown in the topic
change the 0.033 to 0.12 (7 secs)

Try the condition and see how it goes. If you still want a timer trigger it would be better to put in a trigger request


Please read the following disclaimer with regards to the information you may request and obtain on our forum. This specifically concerns trigger files and various instructions as to how to implement a strategy.

  • All members
  • Posts: 8
Re: Condition met for x time prior to trigger
« Reply #9 on: 19 Oct 2022, 10:11 »
Hi Mark,

I have given it a try and providing all other conditions are met, once the 2nd favourite is 1st it automatically triggers. Will explore trigger development, thank you for the help, I've learned alot and it is greatly appreciated.

 

Please note, BetFair is seems to be currently OFFLINE