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 Hwop38, 05-04-2026, 07:02 PM
      0 responses
      169 views
      0 likes
      Last Post Hwop38
      by Hwop38
       
      Started by CaptainJack, 04-24-2026, 11:07 PM
      0 responses
      327 views
      0 likes
      Last Post CaptainJack  
      Started by Mindset, 04-21-2026, 06:46 AM
      0 responses
      252 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      353 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      181 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Working...
      X