Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Output to file not working inside OnBarUpdate

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

    #16
    Hi Lance,

    After a few more attempts I got there. For completeness of this post and maybe you can explain why...

    [1] It only worked when I defined the file name with the other variables outside of the OnBarUpdate method?
    [2] It worked for the Cbi.Core.UserDataDir.ToString() but not for Environment.GetFolderPath(Environment.SpecialFolde r.Desktop) in the file path name?

    Thanks,
    darmbk.

    PS The above might simply be because I had some clumsy coding error rather than these being facts about how a NinjaScript should operate.
    Last edited by darmbk; 06-14-2013, 02:52 PM.

    Comment


      #17
      Glad to hear you got it working.

      Originally posted by darmbk View Post
      [1] It only worked when I defined the file name with the other variables outside of the OnBarUpdate method?
      I would need to look at this specific case to be able to provide you with an answer

      [2] It worked for the Cbi.Core.UserDataDir.ToString() but not for Environment.GetFolderPath(Environment.SpecialFolde r.Desktop) in the file path name?

      Thanks,
      darmbk.
      Try this and it should work for you
      private string path = Environment.GetFolderPath(Environment.SpecialFolde r.Desktop) + @"\yourtextName.txt";

      let me know if I can be of further assistance.
      LanceNinjaTrader Customer Service

      Comment

      Latest Posts

      Collapse

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