Author Topic: Help with IF Statement  (Read 1475 times)

Tags:
  • All members
  • Posts: 80
Help with IF Statement
« on: 13 Jan 2017, 11:19 »
Hi Guys,

Can anyone see what is wrong with the following IF statement?

IF((first1>=50),1,IF(AND(second2>=50,first1<50),2,IF(AND(third3>=50,second2<50),3,IF(AND(fourth4>=50,third3<50),4,IF(AND(fifth5>=50,fourth4<50),5,IF(AND(sixth6>=50,fifth5<50),6,IF(AND(seventh7>=50,sixth6<50),7,IF(AND(eigth8>=50,seventh7<50),8,IF(AND(ninth9>=50,eigth8<50),9,10)))))))))


In the trigger log it evaluates to what is below


IF((first1>=50),1,IF(AND(second2>=50,first1<50),2,IF(AND(third3>=50,second2<50),3,IF(AND(fourth4>=50,third3<50),4,IF(AND(fifth5>=50,fourth4<50),5,IF(AND(sixth6>=50,fifth5<50),6,IF(AND(seventh7>=50,sixth6<50),7,IF(AND(eigth8>=50,seventh7<50),8,IF(AND(ninth9>=50,eigth8<50),9,10))))))))), intermediate:



IF((44.64285714>=50),1,IF(AND(62.82467532>=50,44.64285714<50),2,IF(AND(77.11038961>=50,62.82467532<50),3,IF(AND(89.30551156>=50,77.11038961<50),4,IF(AND(95.97217823>=50,89.30551156<50),5,IF(AND(99.30551156>=50,95.97217823<50),6,IF(AND(102.24668803>=50,99.30551156<50),7,IF(AND(102.96097374>=50,102.24668803<50),8,IF(AND(ninth9>=50,102.96097374<50),9,10))))))))), final: IF((44.64285714>=50),1,2).
22:10:01   


And then set the variable to


Setting variable RankToBet to IF((44.64285714>=50),1,2).

Any help would be appreciated.

  • Élite
  • Posts: 3698
  • Gender: Male
*
Re: Help with IF Statement
« Reply #1 on: 13 Jan 2017, 11:37 »
hi
for some reason the variable  ninth9   has no value , check to make sure that you have spelt it correct in the constant or/and the trigger that gives it a value.
also if the variables are for the amount of selections the other reason could be that there were only 8 selections so the variable ninth9 could not have a value.

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.

  • Administrator
  • Posts: 8818
  • Gender: Female
*
Re: Help with IF Statement
« Reply #2 on: 16 Jan 2017, 14:15 »
Also, try removing the unnecessary parentheses:

Turn:

IF((first1>=50), ...

Into

IF(first1>=50, ...
Always try your triggers in Test Mode before switching to real money!

Follow us on Twitter.

Join our WhatsApp chat!

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

 

Please note, BetFair is seems to be currently OFFLINE