Author Topic: Setting variables  (Read 2473 times)

Tags:
  • All members
  • Posts: 57
Setting variables
« on: 24 May 2016, 08:19 »
Hi all
I asked this of support as part of another query but not heard anything after 2 weeks .'Thought I might chuck it out to you all as the curiosity is getting me:

-When you set a variable (individually per market) should it reset at the start of each race?. I have noticed that the variable once set, doesn't reset at the start of the next race automatically, so I tried resetting the variable using a 'set variable to 0' in the trigger at the start(monitoring) of each race and setting it to 1 once a trigger has run within each market .This works fine where the 1st 2 races are monitored but when 3 or more races  are being monitored simultaneously (I am starting monitoring 30 mins out) it causes issues because the variable is set (to 1)  for more than one race at the same time if you get my meaning.  I used the user variables tab to observe the variable change for each race. I thought it would reset for each market automatically or does the previous market need to settle first?
I also tried setting the variable as a constant-set to 0 and having it update to 1 once a trigger ran but it still didn't reset per market
Thanks in advance

  • Élite
  • Posts: 3698
  • Gender: Male
*
Re: Setting variables
« Reply #1 on: 24 May 2016, 10:36 »
hi
can you explain what you want the variable to do.

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: 57
Re: Setting variables
« Reply #2 on: 28 May 2016, 06:14 »
Hi
Thanks for the reply. I was using the variable as I couldn't get one of my triggers to run consistently within a block and after trying everything else (using multiple blocks, less triggers etc) I decided to try using a variable by setting it to '1'  when a trigger had run and using that as a condition to run the 2nd trigger and when that 2nd trigger ran, then set the variable back to '0' This only worked when the first two markets were being monitored but when the third market entered into scope as time progressed, the variable would set to '1' for the third market and affect the second and so on.So, I stopped trying that method. It occurs to me that this can't work when you are monitoring multiple markets as the variable would have to change for each market and not just be a 1 or 0, so maybe I have answered my own question.Hard to explain  this in writing.Since my goal is to understand why the trigger doesn't work perhaps I will post that in illustration and see how we go.
Cheers :o

  • All members
  • Posts: 57
Re: Setting variables
« Reply #3 on: 28 May 2016, 06:25 »
Update-having thought a little more about it, I can only assume that if a variable is set individually per market then it is only reset when that market is settled/finished. Comment appreciated either way. I'll post the trigger too.
Cheers

  • All members
  • Posts: 57
Re: Setting variables
« Reply #4 on: 28 May 2016, 07:59 »
Here is the trigger.Some notes
I have been playing around with the trigger for a while now as a learning exercise but can't get the lchaser trigger to run consistently.It (lchaser) runs sometimes but not others and was wondering if you chaps wouldn't mind having a look at it (before I go mental :) )
I have tried logging a support ticket but Tim and the guys are too busy.

I realise there are, no doubt, far more elegant ways to write this trigger but my knowledge doesn't extend there yet. It is not exactly complex in its theory but took me a while to map out the logic.I start monitoring 30 mins out.The sequence is:

1. The  remember block runs

2. The downward trend block runs

3.The upwardrend block is supposed to run

The first 2 run without a problem but as I said , the lchase trigger will execute sometimes and not others-even if the tradeoutloss trigger runs with 20+ mins to go. As mentioned in the previous posts, I have tried using set variables as well as activate/deactivate blocks when the first triggers have run etc, for each market but no joy.
 I have also tried reducing blocks (to 2 blocks to simplify things),disabling the close (close block) trigger, adding multiple ways to have the same condition be true (e.g. same condition in the lchaser=1 and greater than 1 as per the attached example) etc etc without success.The logs say that the tradeoutloss trigger has run but the lchaser log suggests it hasn't, which is very perplexing-especially as it will suddenly run sometimes and not others.

Anyway, I am probably not seeing something obvious but have been pulling my hair out( :o :o :o)  so any assistance would be appreciated.Cheers

  • Élite
  • Posts: 3698
  • Gender: Male
*
Re: Setting variables
« Reply #5 on: 29 May 2016, 10:08 »
hi
sorry i have just downloaded your trigger.
h'mmm first look you have a problem with the downward trend block.
you have a CLOSE block trigger.
so once the block is closed the triggers have NOT been activated, so how can you expect the upwardtrend/lchaser  trigger to know that the tradeoutloss trigger is equal to 1
ok some times the tradeoutloss block WILL be in front of the upwardrend block and hay presto the ichaser will activate, but most times the upwardtrend block will close so any trigger in that block has not activated.
i need to do some tests now so it will take 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: 57
Re: Setting variables
« Reply #6 on: 30 May 2016, 07:17 »
Hi Mcbee

Thanks for the reply.Yes, I thought the Close Block might be the problem but as mentioned above I tried disabling it (and altering corresponding conditions in the other triggers) with the same result. I also have a condition that says the tradeoutloss must not have run (the And Not condition)
Like I said, I am probably missing something obvious.Take all the time you need.I appreciate the help
Cheers

  • Élite
  • Posts: 3698
  • Gender: Male
*
Re: Setting variables
« Reply #7 on: 30 May 2016, 14:11 »
hi
here is your trigger, there was a conflict with the tradeoutloss trigger because of the cancel bet action.
i have added a new trigger to cancel the bet, all works ok now.

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: 57
Re: Setting variables
« Reply #8 on: 30 May 2016, 21:09 »
Thank you very much mcbee.You are a legend :) I'll give that a go

  • All members
  • Posts: 57
Re: Setting variables
« Reply #9 on: 08 Jun 2016, 08:47 »
that looks to work well-thanks again Mcbee. Did anyone have a comment re variables? i.e..  variable is set individually per market then it is only reset when that market is settled/finished?
Cheers

 

Please note, BetFair is seems to be currently OFFLINE