Author Topic: Read text from a file in a trigger  (Read 1976 times)

Tags:
  • All members
  • Posts: 23
Read text from a file in a trigger
« on: 02 May 2024, 03:35 »
Hi there

Writing a value into a text file using a trigger is straight forward using the 'Write to a file' action. Is it possible to read a value from a text file using a trigger?

Regards
Paul Fone

  • Moderator
  • Posts: 3622
*
Re: Read text from a file in a trigger
« Reply #1 on: 04 May 2024, 10:09 »
Hi
Yes can read a value from a text file.
for example:
selections index is in file
see comparison operator in helpfile for description

If you have specific values for each selection the values can be imported
see importing selections for autotrading in the helpfile
an example is in Item 5 here.
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: 23
Re: Read text from a file in a trigger
« Reply #2 on: 06 May 2024, 01:37 »
Hi Mark

I understand you can import values associated with a selection by importing selections for autotrading, but I still cannot see how I can load a value from a text file when it is not related to a selection name

Eg. Save an account balance on a certain day using the 'write to a file'  trigger action, then use another action to recall this same value on another day. I know you can remember this value using the 'set user variable' action or the 'remember' action but none of these can be recalled if marketfeeder stops and is reloaded

Regards
Paul Fone

  • Moderator
  • Posts: 3622
*
Re: Read text from a file in a trigger
« Reply #3 on: 06 May 2024, 07:08 »
Hi Paul
The way to do this is to add a constant and change "start with initial value" to "remember last value". Then use a trigger to set a user variable with the same name as the constant. It will retain the last value when MFP is shut down.
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: 23
Re: Read text from a file in a trigger
« Reply #4 on: 08 May 2024, 23:30 »
Thankyou Mark

 

Please note, BetFair is seems to be currently OFFLINE