Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to import the live external data to NT8

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

    How to import the live external data to NT8

    Hi all,

    We want to NT8 can read a signal from our local algorithm,

    i,e., we would like to generate the data and save it to a local path, and ask NT8 to read it in every X mins (based on the input data series)

    After read the post on "https://forum.ninjatrader.com/forum/ninjatrader-8/add-on-development/1144206-generate-plot-from-external-data-ninjascript", we found the main problem here is the algo never touch the modular 'OnBarUpdate', and with this error:


    Click image for larger version

Name:	image.png
Views:	153
Size:	13.5 KB
ID:	1329418

    Here is our procedure:

    (1) Download ths sample file ('SampleStreamReader_NT8.zip​'), and add it to indicator.
    (2) Save our signal data to the path: NinjaTrader.Core.Globals.UserDataDir
    (3) the data format is exactly same as the scripts needs..

    Is there any step-by-step tutrial that uesful?

    Thank you



    #2
    Hello arthur0712,

    The error is because the file is in use, your external program needs to write the data at a different time than NinjaTrader is trying to access the file. In addition to that you need to make sure the external software is closing the file after writing so its not in use. You should additionally be able to use the output window to see the actual exception that is happening because the try/catch in that sample is printing the error info.

    Comment


      #3
      Thanks, I just check the output, it shows:

      Click image for larger version

Name:	image.png
Views:	110
Size:	73.7 KB
ID:	1329444

      but it makes me very confusing because the data format should be fine (I attached as below)
      --------------------------------------------------------------------------
      20241227 093000;6050.94;6098.32;6050.94;6098.32;0
      20241227 093100;6049.06;6100.21;6049.06;6100.21;0
      20241227 093200;6048.66;6100.61;6048.66;6100.61;0
      20241227 093300;6049.46;6099.81;6049.46;6099.81;0
      .....
      ---------------------------------------------------------------------------
      Click image for larger version

Name:	image.png
Views:	110
Size:	51.1 KB
ID:	1329445



      Moreover, I closed all external programs, but the issue of 'samplestremwriter' still exist..any help?


      Comment

      Latest Posts

      Collapse

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