Author Topic: Football goal difference condition  (Read 3632 times)

Tags:
  • All members
  • Posts: 60
  • Karma: +0/-0
Football goal difference condition
« on: Tue, 04 October, 2011, 00:30 »
Hi guys,

I would like to add a condition to my bot that calculates the winning team's goal difference before considering firing a trigger.  

The way I'm thinking of achieving this is by creating a formula to deduct team A's score form team B's (and vice versa) and if either one equals the value I want (2 goals or more), then proceed with firing the trigger if all other conditions are also true.

This is what I have so far:

AND    Trigger Expression    (market_score1-market_score2)OR(market_score2-market_score1)    is equal or greater than    2

I'm pretty sure the formula is incorrectly written as I just guessed it to help demonstrate the condition:

1) Does anyone with a bit more experience with the software know how to word this properly?
2) In the event there is no score available I believe the values will be -1 for each score. If this is the case then this calculation should equal 0, and the trigger will fail as it does not equal at least 2. Is this correct? (This is what I would want if the score cannot be verified at anytime)
3) If I've overlooked a better way to achieve what I have describe please let me know. I'd rather not include Excel if possible as it is not needed for anything else.

Thanks in advance for any replies  8)


  • Tim Vetrov
  • Administrator
  • Posts: 4569
  • Karma: +18/-0
  • Gender: Male
*
Re: Football goal difference condition
« Reply #1 on: Tue, 04 October, 2011, 05:10 »
It has the Excel notation for IF function:
AND Trigger Expression IF(OR(market_score1-market_score2=>2, market_score2-market_score1=>2),1,0) is equal to 1
I'm happy to help Monday - Friday, 08:00-18:00 GMT
Буду рад помочь с понедельника по пятницу, 08:00-18:00 GMT

  • All members
  • Posts: 60
  • Karma: +0/-0
Re: Football goal difference condition
« Reply #2 on: Tue, 04 October, 2011, 16:28 »
Thanks a lot Tim, will test it out tonight  :D

  • All members
  • Posts: 60
  • Karma: +0/-0
Re: Football goal difference condition
« Reply #3 on: Wed, 05 October, 2011, 02:47 »
It has the Excel notation for IF function:
AND Trigger Expression IF(OR(market_score1-market_score2=>2, market_score2-market_score1=>2),1,0) is equal to 1

Regrettably this condition is not working. I tested it on 6 matches last night, when the goal difference was 2 or more and all other conditions were met, no trigger was fired.

I then only deleted this condition from my bot, and on all 6 matches the trigger fired, so it must be that particular condition which is freezing the bot.

Anyone got an idea on why this might be happening?

Many thanks.


  • Élite
  • Posts: 4458
  • Karma: +252/-10
  • Gender: Male
*
Re: Football goal difference condition
« Reply #4 on: Wed, 05 October, 2011, 05:36 »
hi
the answer is
>=      NOT    =>
this is why the formulae has failed.
so it should be
IF(OR(market_score1-market_score2>=2, market_score2-market_score1>=2),1,0) is equal to 1


mcbee
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: 958
  • Karma: +46/-2
Re: Football goal difference condition
« Reply #5 on: Wed, 05 October, 2011, 07:23 »
You can avoid an excel IF expression with:

AND abs(market_score1-market_score2) is equal or greater than 2

  • Tim Vetrov
  • Administrator
  • Posts: 4569
  • Karma: +18/-0
  • Gender: Male
*
Re: Football goal difference condition
« Reply #6 on: Wed, 05 October, 2011, 12:21 »
hi
the answer is
>=      NOT    =>
Oops, right. Thank you.
I'm happy to help Monday - Friday, 08:00-18:00 GMT
Буду рад помочь с понедельника по пятницу, 08:00-18:00 GMT

  • All members
  • Posts: 60
  • Karma: +0/-0
Re: Football goal difference condition
« Reply #7 on: Wed, 05 October, 2011, 23:22 »
Thanks for the replies. I implemented mcbee's correction and it is now working.  Nice one  ;D