Author Topic: Being a Bit Thick about User Variables  (Read 6107 times)

Tags:
  • All members
  • Posts: 60
Being a Bit Thick about User Variables
« on: 26 Apr 2013, 12:37 »
Hi All
Really struggling with a trigger. I want to:
1. Have a user variable that is the calculation each resfresh for every selection in a race: it's something like back_price * back_amount.
2. Have another variable that holds the highest value to date for the variable in No.1  i.e it checks value of Variable No.1 each refresh with this variable and, if it's higher, rewrites Variable No.2 with the new, higher value in Variable No.1.
3. After the trigger has been running for at least 2 minutes I fire a bet off if the value exceeds the highest figure recxorded to date.
I've returned tp MF Pro after a long lay off and version 7 is quite different (much better on the whole). However, I thought in version 6 I could:
A. Set a user variable name that contained a selection variable such as sel_index_myvariablename and then it would create a variable for each of the runners. Then I'd be sailing and this would be easy.
B. Please correct me if I'm wrong but the remember variable can't hold the result of calculations on the selection variables thart are remembered.
Bit confused, because I can see that on the home screen I can even define new variables and in engineer mode, also. I've read the manual twice but am being a bit thick about this!
Regards
Ed.

  • Élite
  • Posts: 3698
  • Gender: Male
*
Re: Being a Bit Thick about User Variables
« Reply #1 on: 26 Apr 2013, 13:29 »
hi
when asking for help, it is better to give exact requirements.
  it's something like back_price * back_amount.
is not exactly anything to work on.
is it your requirement to have the back price times the back amount or do you require something else.
if you say what you want to do, then it is easy to convert it into triggers.

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: 60
Re: Being a Bit Thick about User Variables
« Reply #2 on: 26 Apr 2013, 13:49 »
Thanks, McBee, but didn't think it helped to go into all the detail as it obscures the technique. I want to see the wood for my own trees! It is (back_price*back_amount)+(back_price2*back_amount2)+(back_price3*back_amount3) / volume .  Please note volume not back_volume - not a mistake.
Regards
Ed.

  • Élite
  • Posts: 3698
  • Gender: Male
*
Re: Being a Bit Thick about User Variables
« Reply #3 on: 26 Apr 2013, 14:45 »
hi
here is a trigger to start you off and play about with.
i have put a max price of 100, because it started choosing the outsider with 300.00 price that somebody was trying to trade with a few hundred euro.
you might want to restrict the price to less than 20
it will place the bet 2 minutes after you start to monitor the market.

use test mode

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: 60
Re: Being a Bit Thick about User Variables
« Reply #4 on: 26 Apr 2013, 15:25 »
That was quick! Thanks, McBee, I'll use it in test mode till I see what the likely outcome is. Appreciated.
Regards
Ed.

  • All members
  • Posts: 60
Re: Being a Bit Thick about User Variables
« Reply #5 on: 26 Apr 2013, 15:35 »
McBee,
The use of the user variable mvi to hold the value of sel_index taught me something. Your version is about 10 triggers less long than my version! The only slight downside is that if you open it the trigger file when active markets have already been refrshing for more than 2 minutes the bets fire immediately. Is there a way to stop that?
Regards
Ed.

  • Élite
  • Posts: 3698
  • Gender: Male
*
Re: Being a Bit Thick about User Variables
« Reply #6 on: 26 Apr 2013, 16:02 »
hi
the mv and mvi variables are only names that i have given them.
you can change the minutes since refresh, to minutes before the start time.
i put that in because you said
3. After the trigger has been running for at least 2 minutes I fire a bet off


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: 60
Re: Being a Bit Thick about User Variables
« Reply #7 on: 26 Apr 2013, 17:56 »
Thanks, McBee. Can I ask just one question, because for me it's the key missing bit of knowledge. I think I can guess the answer now from your trigger. I was hoping that a user variable could hold one value per selection. You have defined the value of mvi as the value of sel_index . There is only one qualifying sel_index because of the way you have designed the conditions. I have been trying and hoping to have a user variable that would stored one value in, say, mvi per selection and in a later trigger refer to it as r_1_miv or r_2_mvi .  I take it that I can't use this shortcut? It's unfortunate, because in engineer mode every default variable formula that I define is automatically entered next to each seclection. That's what I always have been seeking to create with user variables in my triggers.
Regards
Ed.

  • Élite
  • Posts: 3698
  • Gender: Male
*
Re: Being a Bit Thick about User Variables
« Reply #8 on: 26 Apr 2013, 18:57 »
hi
i have done what i think you wanted.
in the engineer mode or the variable screen type
mv1
mv2
mv3
and so on up to and including mv12
you will now see all 12 amounts changing.
mv1=sel index 1
mv2=sel index 2
and so on
it will place the bet 1 minute before the start time.


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: Being a Bit Thick about User Variables
« Reply #9 on: 07 Oct 2013, 05:42 »
I want to be stupid too... :(  I won't start a new topic.

The example appears to show that I can use a variable name without setting it as a constant and then apply it against a selection

"selections index is equal to mvi"  I thought I had to declare as a constant - this is a lot easier.

I want to count the unmatched in a dutch book prior to in play and then lay them off if there are less than (say) 2

Name Back_Matched Value Back_Matched Individually for each Market Conditions Markets minutes before the off >0.1

If <2 Then

Cancel Back Lay at SP Selections all but matching selections

conditionsBack_Matched <3 Market  in play

Is there a need to 'remember' the unmatched? I can't see why, they're sitting there
and the back is saying effectively 'not if in play?'

If every trigger is activated every time the market is refreshed it's making my head spin..!!

Are the triggers processed top down?








  • Moderator
  • Posts: 3597
*
Re: Being a Bit Thick about User Variables
« Reply #10 on: 07 Oct 2013, 09:51 »
Hi paulw
I shall try to answer your queries first, and then we can look at your trigger requirement and try and help you with it.

QUERIES
Any user variable that is going to be used in an expression or formula should be initialised (declared) beforehand, or the formula will not work. If the variables are going to be updated periodically, as in the example you refer to above, the first trigger is a reset mechanism to start the variables with a value of zero. You can initialise  a variable either by using a constant, or by using the set user variable trigger action, depending on the requirement.

The entire trigger file is read top down and processed on each refresh of the market.
If you have a trigger that is executed once per market:
The trigger file will be processed
If the conditions are all met, the trigger will fire
On the next refresh:
The trigger file will be processed
If the conditions are all met, the program detects the trigger has already been executed once in this market, the trigger will not fire again in that market.

If you have a trigger that is executed no more often than x:
The trigger file will be processed
If the conditions are all met, the trigger will fire
On the next refresh:
The trigger file will be processed
If the conditions are all met, the trigger will fire again
etc.

TRIGGER REQUIREMENT
Please can you confirm in English exactly what you are wanting to do, and then I can help you to make a trigger for it. From your post, it is a little unclear, but reading your post this is what I understand:

You have already fired into the market a Dutch Back to your own book % (I think it is a Dutch Back because you talk about counting matched back bets)
At a specific time (please clarify the time you want to do this)
Count the number of unmatched back bets
If the number of unmatched back bets is less than 2
Cancel the unmatched back bets, and
Resubmit these as lay bets at the SP price after the off

Now, from a trading perspective, the above set of instructions does not make sense. If you could please just list in English, similar to what I have done, exactly what you want to do, I’m sure we can sort something.  
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.

 

Please note, BetFair is seems to be currently OFFLINE