Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Best method to send bar data to external program and receive order?

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

    Best method to send bar data to external program and receive order?

    Hello, I am wondering what would be the best method to achieve the below.

    After every bar close, grab bar information (open, high, low, close, timestamp) and send to a local program (either C# or Python) which would then do filtering and calculations and if it fits the criteria within program, send back to Ninjatrader a possible order (i.e. go long or go short).

    I've thought of a couple ways to work on this such as using the stream writer to write the OHLC values for each bar to a text file and then having my program read the text file and send a possible order, however that seems to be a bit cumbersome and I am running into crossroads as it seems that I have to invoke and use the NTdirect.dll. There doesn't seem to be much documentation and becomes difficult to manage everything through multiple "routes". I wanted to see if anyone had any thoughts on whether this could be achieved more elegantly (maybe through an indicator or strategy) as that may be the fastest and best solution but I'm not sure if an indicator or strategy can communicate with external program.

    I'd appreciate any thoughts about this.

    Thanks!

    #2
    Hello veetotheone,

    It would require unsupported code our Scripting Support team would not be able to assist with to trigger an action in an external program when a bar closes (triggered from OnBarUpdate).

    There is an API that allows data to be sent to an external application, however this would be on each tick and not when the bar closes, nor would be possible to send an order through the API.

    Below is a link to a forum post with details about the API.


    This thread will remain open for any community members that would like to assist with unsupported code.
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

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