Author Topic: Make a constant for highest bank amount  (Read 1733 times)

  • All members
  • Posts: 68
  • Karma: +0/-2
Make a constant for highest bank amount
« on: Sat, 05 January, 2013, 12:08 »
Hello,

How can I make a constant that records the highest level of money in my BF account?

I' d like the constant to remember the (high) value from day to day, increasing it if the money in my account gets higher.

I' m also wondering if this should be a "constant" or a "variable". Not really sure what the difference is.

  • Moderator
  • Posts: 2787
  • Karma: +229/-0
*
Re: Make a constant for highest bank amount
« Reply #1 on: Sat, 05 January, 2013, 12:46 »
Set user variable
Name: high_level
Value: IF(total_funds>high_level,total_funds,high_level)
The above is for real mode.
You could run the trigger periodically, or after each market.

A constant is just that (stays the same). A variable changes. In the above example you would set a constant to initialise the high_level variable. e.g value=0 to start, or to reset a variable at the start of each new market, or day etc.

Here is the value formula which should work with both test mode and real mode. I have not tested it so please try it using test mode.
IF(test_mode=1,IF(test_funds>high_level,test_funds,high_level),IF(total_funds>high_level,total_funds,high_level))
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: 68
  • Karma: +0/-2
Re: Make a constant for highest bank amount
« Reply #2 on: Sat, 05 January, 2013, 13:34 »
Thanks Mark.

I created a variable called "high_level" and set the scope to "Horse Racing". Then I right clicked on the variable name and clicked on "set value", then I typed in the value as you suggested. The value now shows "unknown variable scope" in red.

I tried changing the scope to Global Scope but it the "value" field still shows "unknown variable scope" in red.

Have I missed something?

  • Moderator
  • Posts: 2787
  • Karma: +229/-0
*
Re: Make a constant for highest bank amount
« Reply #3 on: Sat, 05 January, 2013, 14:09 »
Hi
Here is a trigger which will update the high_level variable once per market. You can set your own conditions when you want it to run. If you add the trigger to the end of your trigger file, it will update the high_level variable after your trigger file has completed. You can view the value in View Variables window.
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.

  • Moderator
  • Posts: 4013
  • Karma: +235/-9
  • Gender: Male
*
Re: Make a constant for highest bank amount
« Reply #4 on: Sun, 06 January, 2013, 01:29 »
hi
the constant should be set to.
remember last value


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.

  • Moderator
  • Posts: 2787
  • Karma: +229/-0
*
Re: Make a constant for highest bank amount
« Reply #5 on: Sun, 06 January, 2013, 08:27 »
hi
the constant should be set to.
remember last value


mcbee
quite right mcbee - thank you - corrected trigger file attached.
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: 68
  • Karma: +0/-2
Re: Make a constant for highest bank amount
« Reply #6 on: Mon, 07 January, 2013, 06:46 »
Thanks, folks.

I'm going to try this out today.