Pages:
Actions
  • #1 by nicbot on 11 Aug 2013
  • Variable scope - individually for each selection

    Is that possible?
  • #2 by Tim (WellDoneSoft) on 11 Aug 2013
  • somename_sel_id
  • #3 by nicbot on 12 Aug 2013
  • somename_sel_id

    Can you write it for dummies?  ;D

    somename_sel_id will be handled as a variable name "somename_sel_id", so if I use this variable for all selection they will all change the same value.

    Do I miss something to get the variable name be handled dynamic?

    Thanks
  • #4 by Tim (WellDoneSoft) on 12 Aug 2013
  • Nope. The somename_sel_id trigger expression will become
    somename_1234234
    somename_3453564
    somename_6456345
    etc. for each selection.
    So if you write a trigger:
    Action: set user variable somename_sel_id value back_price
    it will create number of variables (selections that met conditions of the "set variable" trigger) to the current back price of each selection. Then you can use them from another trigger say:
    Action: back
    Price: somename_sel_id+2
  • #5 by nicbot on 12 Aug 2013
  • It still will not work :(


    First trigger:

    set user variable
    Name: somename_sel_id
    Value: back_price

    Selection: All Matching Selections



    Second trigger (when market is suspended):

    write to action log
    Text: Selection variable [sel_index] [sel_name] ([sel_id]): [somename_sel_id]

    Selection: All Matching Selections



    The output in the action log file is:

    Selection "2. Wood Glitter": Selection variable 2 2.WoodGlitter (7430185): 12.50
    Selection "1. Afan Angeleyes": Selection variable 1 1.AfanAngeleyes (5767049): 12.50
    Selection "6. Compass Jay": Selection variable 6 6.CompassJay (7569994): 12.50
    Selection "5. Whisky Moss": Selection variable 5 5.WhiskyMoss (6490137): 12.50
    Selection "4. Zoes Princess": Selection variable 4 4.ZoesPrincess (7551482): 12.50
    Selection "3. Skara Brae": Selection variable 3 3.SkaraBrae (7211544): 12.50.

    So somehow the somename_sel_id was the same for all 6 selections.


    What did I do wrong?
  • #6 by mcbee on 18 Aug 2013
  • hi nicbot
    could you include your trigger so that i can see what the problem is.

    mcbee
  • #7 by nfgrilo on 18 Dec 2013
  • Hi,

    I am having this same issue, trying to define a variable per selection (like "test_sel_id") but the same value is defined for all!

    Did you ever come up to a solution? Is there a workaround?

    Thanks in advance,
    Nuno
  • #8 by mcbee on 18 Dec 2013
  • hi
    you cannot have 1 variable to set all selections values.
    you can use remember to record different selections values.
    if you want to set a variable to a certain rank or index, then use r_1_sel_id or s_1_sel_id.
    r=rank
    s=index
    1=favourite

    if you include your trigger i will look at it and do what is required to get it working.


    mcbee
  • #9 by nfgrilo on 18 Dec 2013
  • Hi,

    Thank you so much for providing help/tips!

    I don't think that this last tip will solve the issue. Let me explain what I am trying to do:
    I want to calculate ratings based on different factors (with weights), so that each selection has is own rating calculate pre-live, and a dutch-back is made on the top 3 selections with better ratings.

    For the bet part, assuming I would have a "rating" variable, I would define a condition to sort selections by this variable, and restrict to the top 3 by looking at the matching_index.

    However, when I calculate the rating, I found no way to store it associated to a selection (like the "remember selection values" does). The ideal solution would be to have a scope "Selection" when defining a variable, that could be accessed much like the "remembered" ones (referring to variable "a" would access the "a" value of the selection being evaluated).

    I have attached a minimal sample trigger that exemplifies what I am trying to do (it doesn't work as all variables get the same value). The final one would be more complex, as I want to add a form factor (among others), based on if the silk_form contains specified sequences.

    Do you have an idea how a rating per selection could be implemented in MF?

    Thank you in advance!

    Best regards,
    Nuno
  • #10 by mcbee on 18 Dec 2013
  • hi
    here is a trigger to try.
    you need to think about restricting the selection with lower prices, because at times there was a selection that had 75.00 then dropped to 60.00
    also the lay volume/volume was the highest in the selections, thus making it a bet.
    the problem you will have is the price rank could be top but the volume rank 2nd or third and reverse,making it not a selection do no bets placed.
    if you add more rankings then you may not get any bets placed.

    mcbee

    download the trigger below
  • #11 by nfgrilo on 18 Dec 2013
  • Hi,

    Thank you for your reply. Very interesting your workaround you implemented on the attached bot! I will take it as an inspiration to build a ratings bot!

    While this OK as a workaround, it was much more simpler and more powerful to have "Selection scope variables" (that would act much like "remembered variables"). Do you have any idea of how could this submitted as a feature request to MF developers?

    Thank you once again - you have been very helpful!

    Nuno
  • #12 by mcbee on 18 Dec 2013
  • hi
    you would have to post a request in suggestions.

    mcbee
  • #13 by nfgrilo on 18 Dec 2013
  • Hi,

    Again, thank you.
    For the record, here's the link to the feature request based on this thread:
    http://community.welldonesoft.com/suggestions-6/selection-scope-for-user-variables/

    Nuno
Pages:
Actions