Author Topic: Help adding a complex condition to a trigger [TCKTRJM-796953]  (Read 2927 times)

Tags:
  • Administrator
  • Posts: 8821
  • Gender: Female
*
Copied from a support request:

Quote
I have created a trigger which lays selections only if certain conditions are met. It works well and now I want to set the maximum odds for each selection according to rank, but can't figure out the correct way to do it.

So for example, lay the selection:
IF it is the favourite AND his odds are below 2
OR it is the second favourite AND his odds are below 4
OR it is the third favourite AND his odds are below 6
OR it is ranked between 4 and 10 AND his odds are below 20
OR it is any other rank AND his odds are below 50

I have tried to figure this out on my own but am stumped. I hope someone can help me.

Thanks
Always try your triggers in Test Mode before switching to real money!

Follow us on Twitter.

Join our WhatsApp chat!

Присоединяйтесь к официальному Telegram-каналу!

  • Nerd
  • Élite
  • Posts: 462
  • Gender: Male
  • I think I could be on to something here!
*

I would cheat like this in the amount box ...

IF(AND(sel_order=1,lay_price<2),fav_stake,0) if all conditions not met then zero

copy paste and expand ..

IF(AND(sel_order=1,lay_price<2),fav_stake,IF(AND(sel_order=1,lay_price<2),fav_stake,IF(AND(sel_order=1,lay_price<2),fav_stake,IF(AND(sel_order=1,lay_price<2),fav_stake,0))))

origonal condition pasted into zero to expand.

IF(AND(sel_order=1,lay_price<2),fav_stake,IF(AND(sel_order=2,lay_price<4),second_fav_stake,IF(AND(sel_order=3,lay_price<6),third_fav_stake,IF(AND(sel_order>3,,sel_order<11,lay_price<20),mid_fav_stake,IF(AND(sel_order>10,lay_price<50),outside_fav_stake,0)))))

edit carefully as necessary.

if all conditions are not met, amount will be zero and no bet will be placed.

make *fav_stakes constants for easy setting of amount . Also note it is possible to lay the whole field (or close) if "all matching selections" in selected and no other filters are applied.

I have had up to 10 IF's .. very messy if you have to edit something, but works very well too.

untested in MFP, just typed it here so double check syntax and test run.
Fortune favors the brave!

  • All members
  • Posts: 1
Thanks for the reply 1oser - you are obviously much more experienced than me when it comes to programming triggers because your formulas lost this beginner I'm afraid!

However, I think I stumbled upon a solution on my own which I've tested a couple of times and it *seems* to work, though it needs more testing before I'm fully satisfied. It's putting an AND block comprising a series of ORs in the conditions as follows:

AND

      OR Selection's rank is equal to 1
           and Selection's Back Price is less than 2

      OR Selection's rank is equal to 2
           and Selection's Back Price is less than 4

      OR Selection's rank is equal to 3
           and Selection's Back Price is less than 6

      OR Selection's rank is between 4 and 10
           and Selection's Back Price is less than 20

      OR Selection's rank is greater than 10
           and Selection's Back Price is less than 50

  • Nerd
  • Élite
  • Posts: 462
  • Gender: Male
  • I think I could be on to something here!
*
 ;D ;D ;D

far simpler solution ... good luck  :)
Fortune favors the brave!

 

Please note, BetFair is seems to be currently OFFLINE