Pages:
Actions
  • #1 by markoone11 on 29 Aug 2018
  • Hi,

    I wrote a trigger today to test out a strategy I am working on.

    Its pretty standard stuff, I lay at SP with max price = 1000, using a liability. Once the SP bet has been placed, the next action will log this into a text file.

    After I inspected the text file, I was quite alarmed to discover that when MFP is writing the selections name into the file, there is a space for every character in the selections name. Also, the trigger is not adding in a carriage return

    See image.

    Is this a bug? If so, how can I get round this?

    Thanks

    Mark.
  • #2 by Oxa (WellDoneSoft) on 29 Aug 2018
  • Hello!

    The file is in Unicode but originally was created as an Ansi file, hence the weird look of the letters in the file.

    You need to delete it and let MF Pro create it anew.
  • #3 by markoone11 on 29 Aug 2018
  • Hi Oxa,

    Thanks for the reply. I have a selection file generator, which creates an empty file, and the selections file.

    I will look to use

                    if (File.Exists(paths.selFolder + @"SP\" + post))
                    {
                        File.Delete(paths.selFolder + @"SP\" + post);
                    }
                    File.WriteAllText(paths.selFolder + @"SP\" + post, "", Encoding.Unicode);

    which will create an empty unicode text file...

    Interesting how I have used that code to write other files, and as you have indicated, it will by default create an ansi file, and I have not witnessed this before.

    Thanks for letting me know. I appreciate that if there is no file there, MFP will create one on the first run, but that gives me a problem because I have wrote monitoring software, which means the presence of the file is essential..

    Hopefully the above will solve the issue anyway. We shall see..

    Thanks again

    Mark.
Pages:
Actions