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 CarlTrading, 03-31-2026, 09:41 PM
      1 response
      152 views
      1 like
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      89 views
      1 like
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      131 views
      2 likes
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      127 views
      1 like
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      107 views
      0 likes
      Last Post CarlTrading  
      Working...
      X