Author Topic: Variable scope - individually for each selection  (Read 7196 times)

Tags:
  • All members
  • Posts: 32
Variable scope - individually for each selection

Is that possible?

  • Tim Vetrov
  • Administrator
  • Posts: 4870
  • Gender: Male
*
Re: Variable scope - individually for each selection
« Reply #1 on: 11 Aug 2013, 09:40 »
somename_sel_id
Proud to be 🇺🇦
I'm happy to help Monday - Friday, 08:00-18:00 GMT
Буду рад помочь с понедельника по пятницу, 08:00-18:00 GMT

  • All members
  • Posts: 32
Re: Variable scope - individually for each selection
« Reply #2 on: 12 Aug 2013, 11:06 »
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

  • Tim Vetrov
  • Administrator
  • Posts: 4870
  • Gender: Male
*
Re: Variable scope - individually for each selection
« Reply #3 on: 12 Aug 2013, 12:33 »
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
Proud to be 🇺🇦
I'm happy to help Monday - Friday, 08:00-18:00 GMT
Буду рад помочь с понедельника по пятницу, 08:00-18:00 GMT

  • All members
  • Posts: 32
Re: Variable scope - individually for each selection
« Reply #4 on: 12 Aug 2013, 13:18 »
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?

  • Élite
  • Posts: 3698
  • Gender: Male
*
Re: Variable scope - individually for each selection
« Reply #5 on: 18 Aug 2013, 05:43 »
hi nicbot
could you include your trigger so that i can see what the problem is.

mcbee
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: 12
Re: Variable scope - individually for each selection
« Reply #6 on: 18 Dec 2013, 01:13 »
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

  • Élite
  • Posts: 3698
  • Gender: Male
*
Re: Variable scope - individually for each selection
« Reply #7 on: 18 Dec 2013, 07:14 »
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
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: 12
Re: Variable scope - individually for each selection
« Reply #8 on: 18 Dec 2013, 13:04 »
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

  • Élite
  • Posts: 3698
  • Gender: Male
*
Re: Variable scope - individually for each selection
« Reply #9 on: 18 Dec 2013, 17:07 »
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
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: 12
Re: Variable scope - individually for each selection
« Reply #10 on: 18 Dec 2013, 21:31 »
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

  • Élite
  • Posts: 3698
  • Gender: Male
*
Re: Variable scope - individually for each selection
« Reply #11 on: 18 Dec 2013, 21:46 »
hi
you would have to post a request in suggestions.

mcbee
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: 12
Re: Variable scope - individually for each selection
« Reply #12 on: 18 Dec 2013, 22:14 »
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

 

Please note, BetFair is seems to be currently OFFLINE