Author Topic: #all_active# import flag and automatic reimport  (Read 534 times)

Tags:
  • All members
  • Posts: 2
  • Gender: Male
Greetings. 

I’m trying to understand the interaction between the #all_active# import flag and automatic reimport.

I need to import changing trigger variables from a text file, so “Reimport every n seconds” is essential.

I also need all runners in all loaded markets to remain active, which appears to be exactly what #all_active# is intended to achieve. However, these two features appear to be incompatible. On an initial/manual import containing #all_active#  all selections remain active as expected. But as soon as “Reimport every 1 sec” is enabled, selections which aren't explicitly listed in the file become inactive/grey. This matters because although prices for grey selections continue to update in the MarketFeeder interface, triggers no longer operate on those inactive selections. That also prevents a file-writing trigger from continuously exporting the complete market data required by the external application.

I have reproduced this with a completely static file containing only #all_active# (no newline / CR) With automatic reimport disabled, the markets remain active. Enable automatic reimport and all markets grey out. So this behaviour isn't caused by another application rewriting or temporarily emptying the file.

My main question is: why do #all_active# and automatic reimport apparently not work together? Is this expected behaviour, a limitation, or a bug? If it is expected behaviour, is there another supported way of achieving the intended combination: periodically reimport changing values for particular selections, while keeping every selection active for triggered betting?

All help gratefully received at this point! 



  • Moderator
  • Posts: 3734
*
Re: #all_active# import flag and automatic reimport
« Reply #1 on: 30 Sep 2026, 10:48 »
Hi
Had a play with this and have replicated the issue. Actually came across it by chance. Did CTRL A on the text file and found some CR/LF after #all_active#.
I found if you correct the text file without reloading the markets, the selections will remain greyed out.
But if the text file is perfect on the first import, then all other selections will not be greyed and automatic re-import works fine
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: 2
  • Gender: Male
Re: #all_active# import flag and automatic reimport
« Reply #2 on: 04 Oct 2026, 23:41 »
Thx for taking the time to look at this - been away for a few days for work and only got to look at this again today. 

I'd checked the file for with and without <CR> and was sure it wasn't there. I've done a load of testing this evening and have finally nailed it down. It appears to be caused by a race condition with my Python script and the MF script trying to read the import file at exactly the same time. For normal Python on Windows, it *should* not create an exclusive lock that prevents another process from reading the file at the same time. Multiple processes can normally have the file open for reading concurrently. 

To test, I created another version of my code that does everything else exactly the same, but doesn't attempt to read the import file.... and everything stays perfectly live, nothing greys out. I am now working on a version that avoids the race condition! :)

I do therefore think though that if MF tries to read the import file at exactly the same moment another process is reading it, it silently fails and reads it as empty - and then everything greys out. I also believe that once this has happened, the file will no longer be correctly imported. (This is the part that is speculative, I would think that on the next successful / correct import, the markets would go green again but they don't seem to - once they go grey, that seems to be the permanent state until the markets are reloaded).

Would be good to understand what happens under the hood with the reimport function to be completely sure. 

Thanks again! 

 

Please note, BetFair is seems to be currently OFFLINE