Author Topic: Getting the results of an IF statement....  (Read 3026 times)

Tags:
  • All members
  • Posts: 31
  • Gender: Male
Getting the results of an IF statement....
« on: 07 Oct 2016, 13:36 »
Hi,
I have this parsing correctly..

IF ((g_ticks(lastunmatchedlayprice,lay_price)>gap), r_ticks(lastunmatchedlayprice,3), r_ticks(lastunmatchedlayprice,1))

as I see for example at any one time

IF (7>3, 1.96, 1.94)

How can I can gain access to the result..? i.e 1.96 or 1.94 and get it as a variable...

I have tried setting a user variable with the value of IF ((g_ticks(lastunmatchedlayprice,lay_price)>gap), r_ticks(lastunmatchedlayprice,3), r_ticks(lastunmatchedlayprice,1))

but it doesn't seem to do anything...

thanks..


  • Moderator
  • Posts: 3597
*
Re: Getting the results of an IF statement....
« Reply #1 on: 07 Oct 2016, 14:00 »
Hi
when I tested it, it did not parse, result was, using your example:
IF ((7>3), 1.96, 1.94)

using bu_layp instead of lastunmatchedlayprice and removing the one set of brackets, this parses correctly and can be written to a user variable:
IF(g_ticks(bu_layp,lay_price)>3, r_ticks(bu_layp,3), r_ticks(bu_layp,1))
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: 8821
  • Gender: Female
*
Re: Getting the results of an IF statement....
« Reply #2 on: 07 Oct 2016, 19:19 »
So, like MarkV says, check that your variable lastunmatchedlayprice is set correctly.
Always try your triggers in Test Mode before switching to real money!

Follow us on Twitter.

Join our WhatsApp chat!

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

  • All members
  • Posts: 31
  • Gender: Male
Re: Getting the results of an IF statement....
« Reply #3 on: 07 Oct 2016, 20:09 »
Cheers guys...

Is it possible to have AND statements in IF statements....like

IF(THIS AND THAT), X, Y)

  • Moderator
  • Posts: 3597
*
Re: Getting the results of an IF statement....
« Reply #4 on: 08 Oct 2016, 07:37 »
Hi
Certainly, here's an example from the helpfile:
IF(AND(last_won>=0, total_won>0), 4.0, IF(last_won<0, 4-last_won))
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: 31
  • Gender: Male
Re: Getting the results of an IF statement....
« Reply #5 on: 09 Oct 2016, 14:16 »
thank you.. and if I wanted to add multiple and checks

IF(AND(this>500,that<100)OR(whatever>X, thatever<Y), r_ticks(back_price,1), back_price)

would that work?

  • Moderator
  • Posts: 3597
*
Re: Getting the results of an IF statement....
« Reply #6 on: 09 Oct 2016, 15:13 »
Hi
Yes IF, AND, OR functions are supported.
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: 31
  • Gender: Male
Re: Getting the results of an IF statement....
« Reply #7 on: 09 Oct 2016, 16:48 »
Ah cool, so the syntax I used above would be ok?

  • Moderator
  • Posts: 3597
*
Re: Getting the results of an IF statement....
« Reply #8 on: 09 Oct 2016, 18:03 »
Hi
I think one of these depending on your requirement:
IF(AND(AND(this>500,that<100),OR(whatever>X,thatever<Y)),r_ticks(back_price,1),back_price)
IF(OR(AND(this>500,that<100),OR(whatever>X,thatever<Y)),r_ticks(back_price,1),back_price)
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: 31
  • Gender: Male
Re: Getting the results of an IF statement....
« Reply #9 on: 10 Oct 2016, 08:21 »
Thanks MarkV,

Is there a way of having three results within an IF, more than the bollean result of true or false..

IF (this, X), (OR that, Y), (OR whatever, Z)

  • Moderator
  • Posts: 3597
*
Re: Getting the results of an IF statement....
« Reply #10 on: 10 Oct 2016, 18:54 »
Hi
A nested IF could be a possible. The are several topics on the forum relating to "nested IF". The nested IF could just as well be a nested OR, or a nested AND, or any combination. It really depends on your end result required, I'd say probably a lot easier to use trigger conditions for this.
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.

 

Please note, BetFair is seems to be currently OFFLINE