Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 bortz, 11-06-2023, 08:04 AM
    47 responses
    1,602 views
    0 likes
    Last Post aligator  
    Started by jaybedreamin, Today, 05:56 PM
    0 responses
    8 views
    0 likes
    Last Post jaybedreamin  
    Started by DJ888, 04-16-2024, 06:09 PM
    6 responses
    18 views
    0 likes
    Last Post DJ888
    by DJ888
     
    Started by Jon17, Today, 04:33 PM
    0 responses
    4 views
    0 likes
    Last Post Jon17
    by Jon17
     
    Started by Javierw.ok, Today, 04:12 PM
    0 responses
    12 views
    0 likes
    Last Post Javierw.ok  
    Working...
    X