Author Topic: Importing Values from Text File  (Read 1966 times)

Tags:
  • Élite
  • Posts: 110
*
Importing Values from Text File
« on: 08 Jul 2016, 20:50 »
Hi,

I'm importing selections for auto trading from a text file. I'm always importing exactly one selection per market and would like to set a user variable with an imported value.

So there is the variable "imported_1". I can see its value via the user variable tab  (e.g. "s_1_imported_1") but I can't get it to work in a trigger (set user variable, value = imported_1).

Can someone please give me a pointer how to solve this problem.

Thanks!

  • Moderator
  • Posts: 3597
*
Re: Importing Values from Text File
« Reply #1 on: 09 Jul 2016, 06:04 »
Hi
I tested this and did not have any problems? See attached screenshot.
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.

  • Élite
  • Posts: 110
*
Re: Importing Values from Text File
« Reply #2 on: 09 Jul 2016, 11:11 »
Hi Mark,

Yes, it seems to work :)

I was playing around with the variable before and I overlooked that when looking at User Variables via the User Variables tab that they are set to Globally, so they won't change value unless the trigger is being reset.

Thanks a lot for looking into it.

  • Élite
  • Posts: 110
*
Re: Importing Values from Text File
« Reply #3 on: 10 Jul 2016, 20:39 »
Hi Mark,

I have another problem now. If I put the names in exclamation marks they won't be imported. If I import without exclamation marks the trigger expression Selections's Name is in list does not fire.

Can you please double check from your side whether this problem is on my end or whether it is a general problem.

Thanks in advance

  • Moderator
  • Posts: 3597
*
Re: Importing Values from Text File
« Reply #4 on: 11 Jul 2016, 07:16 »
Hi
If you are using a comparison operator in a trigger expression, you need double quotes if the string contains a space.
Attached please see two workarounds.
In the first, we add another line to the text files for the selection using quotes.
In the second, we use imported_1 value in quotes.

Also tested is in list after importing, and find no problems, see third screenshot.
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.

  • Élite
  • Posts: 110
*
Re: Importing Values from Text File
« Reply #5 on: 11 Jul 2016, 14:49 »
Hi Mark,

Many thanks for your reply.

Your first example works fine with me, too  :) Thanks a lot!

Your second example does not work with me. It will import the runner names and values but trigger won't fire.

Your third example works fine, too.

I don't know whether it is possible to adjust the code so we just had to put the runner name in exclamation marks and can import it together with values.

It would be easier and more consistent.


 

Please note, BetFair is seems to be currently OFFLINE