Pages:
Actions
  • #1 by Jr Galgos on 08 Feb 2018
  • Friends,
    I'm developing my first trigger.

    How can I generate a selection (for use in a dutching) that depends on whether one of the 3 conditions below is true (are they in the orders that should be tested)?
    I have a constant numeric MBP

    IF (Back Price of the 3th Favorite - Back Price of the Favorite)> MBP, selects the 2 first favorites

    IF (Back Price of the 4th favorite - Back Price of the favorite)> MBP, selects the 3 first favorites

    IF (Back Price of the 5th favorite - Back Price of the favorite)> MBP, selects the 4 first favorites

    In a second step, before doing the dutching, compare with tips that I will upload via TXT file (this is for a next topic)

    Thank you very much in advance

    Jr Galgos

  • #2 by MarkV on 09 Feb 2018
  • Hi
    in test mode try condition blocks like this:
    OR
      selections rank is between 1 and 2
      and selections trigger expression r_3_back_price-r_1_back_price is greater than MBP
    OR
      selections rank is between 1 and 3
      and selections trigger expression r_4_back_price-r_1_back_price is greater than MBP
    OR
      selections rank is between 1 and 4
      and selections trigger expression r_5_back_price-r_1_back_price is greater than MBP
  • #3 by Jr Galgos on 09 Feb 2018
  • Hi
    in test mode try condition blocks like this:
    OR
      selections rank is between 1 and 2
      and selections trigger expression r_3_back_price-r_1_back_price is greater than MBP
    OR
      selections rank is between 1 and 3
      and selections trigger expression r_4_back_price-r_1_back_price is greater than MBP
    OR
      selections rank is between 1 and 4
      and selections trigger expression r_5_back_price-r_1_back_price is greater than MBP
    Thanks MarkV

    For testing, I created 3 blocks with the Alert command action:

    BLOCk1:
    selections rank is between 1 and 2
    AND
    selections trigger expression r_3_back_price-r_1_back_price is greater than MBP

    BLOCK2:
    selections rank is between 1 and 3
    AND
    selections trigger expression r_4_back_price-r_1_back_price is greater than MBP

    BLOCK3:
    selections rank is between 1 and 4
    AND
    selections trigger expression r_5_back_price-r_1_back_price is greater than MBP

    MBP = 4.9

    Example 1:
    Greyhound racing (G1, G2 ... G6), we have the following back_prices, when monitoring begins:
    G1 = 2, G2 = 4, G3 = 5, G4 = 7, G5 = 10, G6 = 15
    --> result: BLOCK2 and BLOCK3 are executed and should be only BLOCK2.

    Example 2:
    Greyhound racing (G1, G2 ... G6), we have the following back_prices, when monitoring begins:
    G1 = 2, G2 = 4, G3 = 8, G4 = 12, G5 = 14, G6 = 15
    --> result: BLOCK1, BLOCK2 and BLOCK3 are executed and should be only BLOCK1.

    Summarizing: the trigger has to test the conditions in the sequence and, finding a true one, do not test the following ones.
    In my trigger, I will not do 3 blocks; I need the condition test to return a unique selection of favorites: G1, G2 or G1, G2, G3 or G1, G2, G3, G4 so that the trigger dutching using only one of these selections.

    If it was in a BASIC type language, it would be easy because I would use IF, THEN, ELSE ... I do not know yet if the MFP supports this type of programming.

    Thanks in advance for the next help.
  • #4 by Jr Galgos on 09 Feb 2018
  • correcting:

    Summarizing: the trigger has to test the conditions in the sequence and, finding a true one, do not test the following ones.
    In my trigger, I will not do 3 blocks; I need the condition test to return a unique selection of favorites (F1,F2 ...): F1, F2 or F1, F2, F3 or F1, F2, F3, F4 so that the trigger dutching using only one of these selections.
  • #5 by Jr Galgos on 09 Feb 2018
  • The programming logic would be:

    r_5_back_price - r_1_back_price > MBP?
    FALSE -> does not execute trigger (not met)
    TRUE --> r_4_back_price - r_1_back_price> MBP?
                   FALSE -> selection = F1, F2, F3, F4 -> executes the trigger
                   TRUE --> r_3_back_price - r_1_back_price> MBP?
                                  FALSE -> selection = F1, F2, F3 -> executes the trigger
                                  TRUE --> select = F1, F2 -> executes the trigger
  • #6 by MarkV on 09 Feb 2018
  • Hi
    OK try like in the screenshot, use two conditions for number of runs in each trigger

    TRIGGER 1
    and trigger 2 number of runs is equal to 0
    and trigger 3 number of runs is equal to 0
    TRIGGER 2
    and trigger 1 number of runs is equal to 0
    and trigger 3 number of runs is equal to 0

    etc.
  • #7 by Jr Galgos on 09 Feb 2018
  • Thanks MARKv

    I was testing using a variable that would change the value before the dutch of each trigger. This variable NUMBER OF RUNS performs better the function. 
    I will test in the next races. 
    The problem is whether the MFP starts testing the conditions of the first block and then tests the conditions of the second and after third.
    If the MFP tests all at the same time, it can first execute the 3rd trigger, when the first one should be executed.

    Example: back prices (favorites in order) -> F1=2, F2=4, F3=8, F4=12, F5=14, F6=15 and MBP = 5.99

    If all blocks are executed at the same time, all will have their conditions = TRUE. 
    If the MFP first executes the 3rd trigger (or MFP will always run, first, the 1st block?), it will be wrong, as it would have to execute only the 1st trigger (dutch in favorites 1 and 2).
    Therefore, the ideal would be some command that forces the execution, FIRST, of the 1st block and, only after, the 2nd and, after, the 3rd.
    As the flowchart below:

    r_3_back_price - r_1_back_price > MBP?
    TRUE ---> Selection's Rank is between 1 and 2 --> run Dutch Back trigger
    FALSE --> r_4_back_price - r_1_back_price> MBP?
              TRUE ---> Selection's Rank is between 1 and 3 --> run Dutch Back trigger
              FALSE --> r_5_back_price - r_1_back_price> MBP?
                        TRUE ---> Selection's Rank is between 1 and 4 --> run Dutch Back trigger
                        FALSE --> condition not yet achieved (does not trigger yet)

    Of course there is another condition that keeps testing the above conditions until just before the market closes (variable OFF)
  • #8 by MarkV on 10 Feb 2018
  • Hi
    If you look at the trigger log you can see what it does, it checks the conditions in the trigger file from the top down, every refresh of the market.

    For example, conditions for trigger 2 and trigger 3 are met:

    checks trigger 1, conditions not met, trigger 1 is not executed
    checks trigger 2, conditions are met, trigger 2 dutch back is executed
    checks trigger 3, conditions are met, but condition trigger 2 number of runs is 0 is FALSE, trigger 3 is not executed

    keep testing and read the logs, you will soon see what is right and wrong
  • #9 by Jr Galgos on 10 Feb 2018
  • Thanks MarkV

    This part of my trigger worked.
    Now I will increment it with more conditions and comparisons with lists of tips.
    Therefore, this topic is fixed.

Pages:
Actions