Author Topic: When is a constant not constant?  (Read 2168 times)

Tags:
  • All members
  • Posts: 16
When is a constant not constant?
« on: 15 Nov 2013, 10:09 »
I've read the manual but I'm still confused.

In my trigger, I have a constant which is defined as 0.1 * balance.
The manual says
"Constants are variables whose values can be defined upon loading a trigger file they are stored in. That is, a constant can be declared before any trigger starts working."

So I load the trigger and all is fine.
I then made a deposit to betfair, and my "constant" was immediately recalculated to reflect the new balance. The trigger was not even running.

So How do I set a truly global constant, i.e. work out 10% of my bank and have that figure available even when the bank changes during the day?

  • Élite
  • Posts: 3698
  • Gender: Male
*
Re: When is a constant not constant?
« Reply #1 on: 15 Nov 2013, 11:12 »
hi
with constants, they must have fixed amounts/letters, not formula's.
if you want to set the day's amount, then use a trigger to set the amount (trigger set to one time only) or add an action to a trigger that is set to one time only.
so Add trigger
set user variable
name (name of the variable)
value  balance*0.1
no condidtions
selection favourite (only used for activating the trigger)
markets all markets
market status  all markets
Execute  one time only

this will set the variable to 10% of your balance and will only change if you reload the 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: 16
Re: When is a constant not constant?
« Reply #2 on: 15 Nov 2013, 12:55 »
Sorted.  :D
Many thanks for the great support, really enjoying getting back into programming with MFP.

  • All members
  • Posts: 16
Re: When is a constant not constant?
« Reply #3 on: 18 Nov 2013, 15:14 »
Next issue - how can I reset total_won (or set it manually to zero) so that I can leave the trigger running from day to day?

  • Élite
  • Posts: 3698
  • Gender: Male
*
Re: When is a constant not constant?
« Reply #4 on: 18 Nov 2013, 16:24 »
hi
the only way to reset total_won is to use a new trigger to reset win/lose history.
so new trigger
action   reset win/lose history
conditions
and selections trigger expression total_won is greater than  (your set profit)
selection favourite (only used for activating the trigger)
markets all markets
market status  all markets
Execute  once per market


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.

 

Please note, BetFair is seems to be currently OFFLINE