Author Topic: sorting order & matching  (Read 6202 times)

Tags:
  • All members
  • Posts: 35
  • Gender: Male
sorting order & matching
« on: 21 Oct 2019, 13:09 »
Hi,

Can you please help with conditions to match the correct selection from the new defined sorted order.

If i define the sorting order by back_price * imported_1 for all selections in market.
I simply want to select the middle value(s).
I have a remember trigger to calculate the median selection/s (ie. odd amount of runner_number's gives 1 remembered selection & even runner_number races gives 2 remembered selections, but i cannot get the condition right - i dont know how to say if sel no.X in the list =X.

The condition i am stuck with is how to choose the 5th or 6th or 7th etc selection in the new defined order.

Trigger expression i am trying to implement looks something like this;
Selection trigger expression "matching_number" _((runner_number+1)/2) is equal to (runner_number+1)/2.
"matching_number" "match_index" or "match_selection"what is the correct way of writing this please?

Hope this sort of understandable.

Many thanks Kristian

  • All members
  • Posts: 35
  • Gender: Male
Re: sorting order & matching
« Reply #1 on: 21 Oct 2019, 13:27 »
will this work/?

match_((runner_number+1)/2) is equal to (runner_number+1)/2

  • Moderator
  • Posts: 3653
*
Re: sorting order & matching
« Reply #2 on: 21 Oct 2019, 17:59 »
Hi
Could be several ways to do this. Here I try the % modulus function to determine odd / even in the expression and it works ok.


Code: [Select]
selections trigger expression match_index is between INTEGER(matching_number /2) and IF(matching_number % 2 = 0, matching_number /2, INTEGER(matching_number /2) +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.

  • All members
  • Posts: 35
  • Gender: Male
Re: sorting order & matching
« Reply #3 on: 22 Oct 2019, 15:23 »
Hi Mark,

That's fantastic, thank you so much for your time.  Works a treat.

Lets hope its a winning bot......

 

Please note, BetFair is seems to be currently OFFLINE