Hello Oxa,
I can tell you that this will not get resolved. I will say without any doubts in my mind, that the writing of the text into the file, will occasionally fail. It works most of the time, but, on occasions, it will fail a few times in the day. I would say 99% of the time it is fine
There are NO conditions set in the trigger, it is a very simple write to text file action, values being horse name, its BSP value, and its win status, using the details outlined above.
This can only be my opinion, but if something works one or more times, with success, then, if it fails at other times, then there must be something wrong elsewhere. Granted if I had added in some exotic instruction within the trigger, we could easily blame this, but, given I set no conditions, and only use the available action to write the race results to a text file, then I am 100% certain there is no fault in the trigger. It writes a file, once the market has settled, and records the details mentioned, for each selection. There is no evidence available within the trigger logs, because nothing has actually happened at the market settle time, as as a result, nothing in the log.
Possibly, but unlikely, it could be some internet connection issue, but in my, perhaps, naive expectation, MFP has dealt with that issue, which I believe is a basic expectation - and, if this is not the case, you should think about putting this in.
Unfortunately, you have seemed to have dismissed this with "This will write to the textfile" - whereas in fact, it doesn't always do this, hence my opening statement that this won't get resolved.
I am not able to run your code in debug mode to detect any issue, but it definitely does fail sometimes.
here is the action..
write to a file
Text ["sel_name"],[actual_sp],[sel_place] File path c:\mypath\myfile.csv
Options...
Selections All Matching Selections
Markets Win Markets Market Status Settled
Execute once per market
NO conditions