Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Inconsistent "COMBINED RESULT"

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Inconsistent "COMBINED RESULT"

    Hi,

    I've made a simple test based on SampleMACrossOver strategy tester code.

    When adding simple C# code to append text in a file, the basket test results (33 symbols) generating inconsistent "COMBINED RESULT" and it's details.

    If removing the statement, the results always consistent. Also, the same code work correctly under NT6.


    Only following was added as a first line under "OnBarUpdate":
    PrintInfo("c:\\process3.txt","file is process3");

    The sub is:

    private void PrintInfo(string fname, string msg)
    {

    StreamWriter SW;
    SW=File.AppendText(fname);
    SW.WriteLine(msg);
    SW.Close();

    }


    Thanks for your support.
    --------------------------------
    NT version 7.0.0.20.

    #2
    mdhanafi68, thanks for reporting - we'll try reproducing and get back to you.

    Comment


      #3
      This is likely related to your code running into file locks, if you check the log tab of the Control Center while you perform the basket backtest witih your snippet added, you see log lines similiar to those -

      8/20/2010 12:14:29 PM|3|128|Error on calling 'OnBarUpdate' method for strategy 'SampleCross/1740b50bfe5d4bd896b0533725622400': The process cannot access the file 'c:\process3.txt' because it is being used by another process.

      This is due to the multithreaded processing of your backtesting in NT7 if more than one core is available.

      Comment


        #4
        Hi Bertrand,
        Thanks. Yes, found the messages.

        I am not sure, if someone else may encounter any similar issues of "multithreaded processing" in the future, which so far not encountered in NT6. Does this multithread processing transparently handled by NT7?


        For your info, based on the sample code, I've add try/catch statement and now it works consistently - thanks to you. Or you may have any better general solution?


        Thanks for your support

        -------------------------
        NT 7.0.0.20

        Comment


          #5
          mdhanafi, Would you be kind enough to post the full working solution please? I would like to have file to record strategy activity accurately, and save it.

          Thanks very much!
          Jon

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          600 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          347 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          103 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          558 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          558 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X