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:	166
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:	122
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:	121
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 CarlTrading, 03-31-2026, 09:41 PM
      1 response
      43 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      20 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      30 views
      1 like
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      47 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      38 views
      0 likes
      Last Post CarlTrading  
      Working...
      X