Author Topic: Cannot get variable sel_place to work  (Read 7176 times)

Tags:
  • All members
  • Posts: 4
Cannot get variable sel_place to work
« on: 29 Jun 2014, 13:09 »
I have developed a trigger which under certain market conditions backs and lays on the favourite in the win market then uses staking recovery to recover losses on the losing bet depending on whether the horse wins or loses.  I have created some user variables which calculate the lay liability and potential winnings and the trigger uses these along with the current back and lay bet values to calculate separately the profit/loss of the back and lay bets.
The trigger remembers the horse on which the back and lay bets were placed then I use the variable sel_place in the settled market to determine whether the horse won or lost in order to then calculate the p/l of both the lay and back bets to then calculate the back and lay stakes for the next qualifying race.
I am using Selections Trigger variable sel_place equals 1 in one trigger and Selections Trigger variable sel_place does not equal 1 in a second trigger in order to determine what actions should be taken if the horse is a winner or a loser.
The problem I am having is that if the horse wins sel_place equals 1 and sel_place does not equal 1 are both returning TRUE and consequently incorrect p/l figures are being calculated. 
If the horse does not win sel_place equals 1 correctly returns false and sel_place does not equal 1 correctly returns true.
Can anyone assist please.  I have attached the 2 triggers which use the variable sel_place.  Thank you.

  • Administrator
  • Posts: 8821
  • Gender: Female
*
Re: Cannot get variable sel_place to work
« Reply #1 on: 01 Jul 2014, 07:27 »
Hi Henry, I'll be working on this case, please await.
Always try your triggers in Test Mode before switching to real money!

Follow us on Twitter.

Join our WhatsApp chat!

Присоединяйтесь к официальному Telegram-каналу!

  • Administrator
  • Posts: 8821
  • Gender: Female
*
Re: Cannot get variable sel_place to work
« Reply #2 on: 02 Jul 2014, 12:34 »
Hi Henry,

The conditions of the triggers you attached refer to a variable "favourite" which must be initialised before the trigger can fire. Can you explain about this variable please, it does not seem to be mentioned anywhere.
Always try your triggers in Test Mode before switching to real money!

Follow us on Twitter.

Join our WhatsApp chat!

Присоединяйтесь к официальному Telegram-каналу!

  • All members
  • Posts: 4
Re: Cannot get variable sel_place to work
« Reply #3 on: 02 Jul 2014, 14:14 »
Hi Oxa,

The "favourite" is a remembered variable and is the horse which has a lay and back matched prior to race start.  I have attached the full block of triggers which should help.


  • Administrator
  • Posts: 8821
  • Gender: Female
*
Re: Cannot get variable sel_place to work
« Reply #4 on: 07 Jul 2014, 13:13 »
Hi henrysdad,

I identified the problem, it was not in your triggers, but rather in the way the program executed triggers in settled markets. It was not a bug, but a behaviour whose logic had to be changed. Therefore you will need to download the fixed program's setup and install it, then run the triggers again.

Below is a quick explanation of the problem, but you may skip it if you want and go straight to the recommendations.

The thing is, the triggers in settled markets may be called twice: first, when new settled bets arrive from your account statement in real mode, second when the winner label appears on the screen. The reason behind this is that the event's outcome generally becomes known a few minutes after the market's bets are settled. And MF Pro has no means to predict whether that outcome will at all be available (for some markets BetFair does not return the outcome). Therefore, the program has to check triggers when it's got settled bets, in case the winners will never arrive. At this point they are not known yet, so both winner_name and sel_place variables are empty. They only acquire values when the triggers are checked the second time.

Recommendations:

If you're checking winner_name or sel_place in your triggers, make sure you add a condition that checks if winner_name is not equal to " ".

Also, as you probably know already, when using strings (i.e. text chunks) in a trigger expression, you must enclose them in double quotes. So the correct spelling for the condition with the selection's name is:

Selection's Trigger Expression "sel_name" is equal to "favourite_sel_name"

I have modified your triggers a little and run some tests to make sure the triggers "updating the total won or lost" were being executed correctly. Yet if you have any further problems, please let me know.
Always try your triggers in Test Mode before switching to real money!

Follow us on Twitter.

Join our WhatsApp chat!

Присоединяйтесь к официальному Telegram-каналу!

  • All members
  • Posts: 4
Re: Cannot get variable sel_place to work
« Reply #5 on: 07 Jul 2014, 15:34 »
Many thanks Oxa.  Could you attach the modified triggers please.

  • All members
  • Posts: 4
Re: Cannot get variable sel_place to work
« Reply #6 on: 07 Jul 2014, 18:41 »
Hi Oxa,

Have now followed your suggestions and amended my triggers.  I have downloaded latest version of MFP.  Have run amended triggers on this evenings greyhounds in test mode and everything now working as expected.
Many thanks for your help once again.

  • All members
  • Posts: 4
Re: Cannot get variable sel_place to work
« Reply #7 on: 09 Jul 2014, 16:09 »
Hi Oxa,

I have run my triggers in real money mode for the first time today and once again I am getting the error where a winner is also being identified as a loser and consequently running totals are once again being calculated incorrectly.  Everything was working fine in test mode ???
I am sure I have followed your recommendations.  I would be grateful if you could have another look at this problem.  Many thanks.

  • Administrator
  • Posts: 8821
  • Gender: Female
*
Re: Cannot get variable sel_place to work
« Reply #8 on: 09 Jul 2014, 16:17 »
Let me look into this.
Always try your triggers in Test Mode before switching to real money!

Follow us on Twitter.

Join our WhatsApp chat!

Присоединяйтесь к официальному Telegram-каналу!

  • All members
  • Posts: 4
Re: Cannot get variable sel_place to work
« Reply #9 on: 10 Jul 2014, 08:08 »
Good Morning Oxa,

I have amended my triggers to use the new user variable winner_name and have updated the program following yesterdays update to .02.  All is working well in test mode.  I will try the triggers in real money mode later today and will let you know how I get on.  So in short please do not waste your time investigating the triggers I posted last night.
However associated with these triggers is the issue of switching wallets which is locking up MF for a few minutes and then interfering with back and lay stakes.  I know this is the subject of a seperate thread and I look forward to an update in due course.

  • All members
  • Posts: 4
Re: Cannot get variable sel_place to work
« Reply #10 on: 11 Jul 2014, 08:27 »
Good morning Oxa,

As promised an update.  I ran the triggers in real time last night.  Because of the delay between the market being settled and the winner being identified I have had to add a couple of extra triggers which deactivate and activate the trigger which makes the back and lay bets.  Currently the Previous Triggered Events status is ..... options do not include one that occurs after the winner has been identified.  Therefore in order for the backing/laying trigger to apply the correct stakes I have to deactivate it until after the triggers which now correctly identify whether the horse/greyhound which was backed and layed won or not have been executed.

  • Administrator
  • Posts: 8821
  • Gender: Female
*
Re: Cannot get variable sel_place to work
« Reply #11 on: 11 Jul 2014, 10:59 »
Currently the Previous Triggered Events status is ..... options do not include one that occurs after the winner has been identified.

Hi henrysdad and thanks for your update! I'd suggest adding one more condition to the one that checks the status, this way it should work. Please see the attached screenshot. I took the conditions of your "betting" trigger and rearranged them. The idea is - a market will not be considered settled until its outcome has arrived.

Please let me know if this makes sense in real mode.
Always try your triggers in Test Mode before switching to real money!

Follow us on Twitter.

Join our WhatsApp chat!

Присоединяйтесь к официальному Telegram-каналу!

  • All members
  • Posts: 4
Re: Cannot get variable sel_place to work
« Reply #12 on: 14 Jul 2014, 11:32 »
Hi Oxa,

Thank you for your suggested amendment to the betting trigger.  Unfortunately this does not work in Real mode.  The betting trigger executes on previous triggered market settlement and does not wait for the winners name.  Therefore the wrong stakes are applied to the next triggerd event because my triggers updating stakes etc have not been executed because they are still awaiting winner_name/sel_place.
Hope this makes sense.
Meanwhile I have reintroduced the activate betting and reactivate betting triggers to stop the betting trigger executing until my triggers updating stakes etc have executed.

  • Administrator
  • Posts: 8821
  • Gender: Female
*
Re: Cannot get variable sel_place to work
« Reply #13 on: 15 Jul 2014, 07:34 »
The betting trigger executes on previous triggered market settlement and does not wait for the winners name.

Would it be possible for you to attach a log from the betting trigger, so that I could check how it processes that condition?
Always try your triggers in Test Mode before switching to real money!

Follow us on Twitter.

Join our WhatsApp chat!

Присоединяйтесь к официальному Telegram-каналу!

  • All members
  • Posts: 4
Re: Cannot get variable sel_place to work
« Reply #14 on: 15 Jul 2014, 16:17 »
Hi Oxa,

Please see the attached 2 trigger logs.  If you look at the timings you will see that the 1455 Sligo race settled at 1502.28 and the winner is not identified until 1504.35 allowing the back and lay stakes to be updated.
However the 1500 Perth race betting trigger executes at 1502.30 before the winner has been identified and therefore backs and lays using the same stakes as in the previous triggered event.

 

Please note, BetFair is seems to be currently OFFLINE