Pages:
Actions
  • #1 by kristoscotto on 21 Oct 2019
  • 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
  • #2 by kristoscotto on 21 Oct 2019
  • will this work/?

    match_((runner_number+1)/2) is equal to (runner_number+1)/2
  • #3 by MarkV on 21 Oct 2019
  • 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)
  • #4 by kristoscotto on 22 Oct 2019
  • Hi Mark,

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

    Lets hope its a winning bot......
Pages:
Actions