Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Importing macro stats into Ninja8

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

    Importing macro stats into Ninja8

    Hi,

    I would be interested to import macro economic stats in Ninja 8, to then be able to run calculations and use it in a strategy script or indicator.
    More specifically, the idea would be to import, for each important economic stat (PMI, gdp, non farm payroll, CPI etc), two numbers (the actual/forecast) and then compute from there the associated surprise (actual minus forecast). For each surprise, there is an associated market move, on a given timeframes (1min, 5min,15 min).
    By regressing the historical data series of associated surprises by the associated market moves, you can then build an intraday fair value indicator that would tell what should be the market move on a given timeframe for an associated economic surprise.
    Example:
    -Inflation YoY, actual 8.8%, expected 9.2%
    -Expected associated market move on bund futures on a 5min timeframe based on historical data: + 20 ticks

    Any idea how to proceed ?

    Best regards

    #2
    Hello MacroTrader347,

    Thanks for your post.

    If the data you need to access is in a text file, you could consider using a StreamReader to read data from a text file.

    See this reference sample demonstrating using a StreamReader: https://ninjatrader.com/support/help...o_read_fro.htm

    Otherwise, you could consider using the NinjaTrader API and creating a custom AddOn that interacts with external applications to get the data.

    NinjaTrader does have an API available as a C# managed and unmanaged assembly. Support for the API is very limited.

    The Application Programming Interface (API) is available in the NTDirect.dll (unmanaged) and NinjaTrader.Client.dll (managed) files for you to use in an external application to interface with NinjaTrader. These two files provide the same functions, however, you may find the NinjaTrader.Client.dll is easier to reference in your custom application.

    Support for the API is limited from NinjaTrader Support. We are not able to assist with any code in an application external to NinjaTrader. We are able to detail the usage of any methods available from the API.

    Below I am providing a publicly available link to the help guide that lists the functions available to the API.

    Help Guide NT8 API functions - http://ninjatrader.com/support/helpG..._interface.htm

    Help Guide NT7 API functions - https://ninjatrader.com/support/help..._interface.htm

    Please also refer to this forum post link for more information about the NinjaTrader API — https://ninjatrader.com/support/foru...art#post793626

    This forum thread will be open for other community members to share their insights on the topic also.

    Let me know if I may assist further.
    <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by NullPointStrategies, Yesterday, 05:17 AM
    0 responses
    62 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    134 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    75 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    45 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    50 views
    0 likes
    Last Post TheRealMorford  
    Working...
    X