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.
    BertrandNinjaTrader Customer Service

    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.
      BertrandNinjaTrader Customer Service

      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 PaulMohn, Today, 09:12 AM
          2 responses
          8 views
          0 likes
          Last Post PaulMohn  
          Started by ETFVoyageur, Today, 05:50 AM
          5 responses
          35 views
          0 likes
          Last Post NinjaTrader_Gaby  
          Started by thumper57, 05-11-2024, 04:30 PM
          13 responses
          39 views
          0 likes
          Last Post NinjaTrader_BrandonH  
          Started by llanqui, Yesterday, 10:29 AM
          2 responses
          15 views
          0 likes
          Last Post llanqui
          by llanqui
           
          Started by llanqui, Yesterday, 11:10 AM
          2 responses
          22 views
          0 likes
          Last Post llanqui
          by llanqui
           
          Working...
          X