Author Topic: import variables from file  (Read 729 times)

Tags:
  • All members
  • Posts: 6
  • Gender: Male
import variables from file
« on: 15 Jun 2020, 11:51 »
Hello,

From time to time I write some variables to a text file, and this works fine.
the data in the file looks like

var1,var2,var3,var4

there are some occasions that I will need to read those previously wrote variables in the file, and update the current trigger variables with those values in the file.

How can I do that?

Thanks for the help




  • Administrator
  • Posts: 8826
  • Gender: Female
*
Re: import variables from file
« Reply #1 on: 19 Jun 2020, 08:16 »
Hello!

You can import them along with selection names via Import Selections for Auto-Trading. See the video tutorial:

https://youtu.be/-zNhSl5ypn0

So you'll need to write to your own import file:

["selection_name"]\t[var1]\t[var2]\t[var3]...

Then press Import Selections for Auto-Trading and import the previously written values. Make sure you press "Reimport every ... sec" (choose the frequency of reimport). After this, the program will automatically check on new values in the file you're writing to and reimport new selections.

Make sure that the syntax is as I suggested above. All values in the import file must be separated with a Tab character (\t). In the triggers, you can access var1, var2, var3, etc. with imported_1, imported_2, imported_3, etc... variables.
Always try your triggers in Test Mode before switching to real money!

Follow us on Twitter.

Join our WhatsApp chat!

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

  • All members
  • Posts: 6
  • Gender: Male
Re: import variables from file
« Reply #2 on: 19 Jun 2020, 10:39 »
Thank you for replying.

And if I just wanted to import this values from file, when I reload the trigger or when I start the trigger.
Lets say that the values in the file, are the "current state variables of the trigger" that I want to reload to initialize the same state, when for some reasons I've to stop the trigger, and then I want to run from the same state.

import using "Import Selections for Auto-Trading" is the best or only way to import, or there are other way ?

thanks

  • Administrator
  • Posts: 8826
  • Gender: Female
*
Re: import variables from file
« Reply #3 on: 29 Jul 2020, 11:15 »
Quote
import using "Import Selections for Auto-Trading" is the best or only way to import

That's correct.
Always try your triggers in Test Mode before switching to real money!

Follow us on Twitter.

Join our WhatsApp chat!

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

 

Please note, BetFair is seems to be currently OFFLINE