Author Topic: Set user variable  (Read 4647 times)

Tags:
  • All members
  • Posts: 490
  • Gender: Male
Set user variable
« on: 09 Oct 2017, 03:55 »
I have am trying to use a 'set user variable' trigger but I get odd results.
My first variable is mv1 where value = market_volume Individually for each market. No more often than 10sec
My second variable is mv2 where value = market_volume Individually for each market. No more often than 2sec

Depending on my market list I may have 2-3 markets active at once.

In my triggers I test the value of mv1 : mv2 within each market but even though I have set 'individually for each market' my triggers appear to pick up different market mv1 and mv2 values regardless I have set 'Individually for each market' 

Even though I use Individually for each market do I need to refer to each market as eg. mv1_market_id and not just mv1

Improvise Adapt Overcome

  • Moderator
  • Posts: 3597
*
Re: Set user variable
« Reply #1 on: 09 Oct 2017, 13:27 »
Hi londolozi
tested this as follows:

mv1 no more often than 10 secs
mv2 no more often than 2 secs
individually for each market
favourite only, or first matching selection i.e. trigger fires for only one selection each refresh
market refresh rate 1 sec

works fine and view variables shows correct figures for each market in focus 

mv1 matches market volume on the main screen every 10 secs
mv2 matches market volume on the main screen every 2 secs
mv2-mv1 shows difference between the two and is zero once every 10 secs

also tested with mv1_market_id etc. with similar results.
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: 490
  • Gender: Male
Re: Set user variable
« Reply #2 on: 10 Oct 2017, 05:23 »
Thank you for your reply Mark,
Perhaps it's the parsing?

The aim of the variable to to monitor market activity. Unlike UK racing we don't get the dynamic indicators like 'behind the barriers' so I am trying to create and equivalent such that some races in AU will be avoided.

The formula I use is mv5 > mv1 + (now_time-refresh_start)/mnt*mktgrowth
mv1 is run once per market
Where mnt = 0.000694 mktgrowth = 2500

In the User Variables window (see Mv1Mv51.jpg not the same race) the results appear to be correct by my manual calculations.

However, as the Mv1Mv5.jpg shows the final = mv1,which suggests my parsing of the formula is not correct.
My calculations says 12512+11346.9 or 23858 but the log shows 12512 (mv1)




Improvise Adapt Overcome

  • All members
  • Posts: 490
  • Gender: Male
Re: Set user variable
« Reply #3 on: 10 Oct 2017, 07:08 »
I found this Thread

So I put all the variables in brackets and now its works?

((((now_time) - (refresh_start)) / (mnt)) * (mktgrowth)) + (mv1)

What are the brackets required? Nothing in help file about this.
Improvise Adapt Overcome

  • Moderator
  • Posts: 3597
*
Re: Set user variable
« Reply #4 on: 10 Oct 2017, 12:35 »
I think you are right about the parsing. I always understood from using Excel, expressions in brackets would be parsed to values first, and then the whole formula would be parsed. There is a page in the manual about the order of parsing variables in MFP, but as you say no guidance on the use of brackets. Glad you have got it working.
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: 490
  • Gender: Male
Re: Set user variable
« Reply #5 on: 11 Oct 2017, 10:40 »
Why does this formula return FALSE.
See image.
The formula asks if mv5 is greater than ((((now_time) - (refresh_start))/(mnt))*(mktgrowth))+ (mv1)
Which results in .... Is 141858 > 60152 answer is FALSE??
Why?
Improvise Adapt Overcome

  • Moderator
  • Posts: 3597
*
Re: Set user variable
« Reply #6 on: 11 Oct 2017, 13:47 »
Hi
mv5_market_id is not parsed and returns 141858_135263523 which is not floating point or integer so condition is FALSE

checking the manual, user variable names cannot contain any variables or functions (even though I tried with _market_id and it seemed ok)

can you try setting user variable mv5 individually for each market
and use mv5 is greater than your bracketed formula? it should work.
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: 490
  • Gender: Male
Re: Set user variable
« Reply #7 on: 12 Oct 2017, 20:43 »
In the end I put mv5 in () as well.
Seems overkill but now it works well.
Any markets that are low in volatility are ignored which was my goal.

The only bug I have now is this

APi feeds stop regularly

Improvise Adapt Overcome

 

Please note, BetFair is seems to be currently OFFLINE