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

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.
    Brandon H.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Segwin, 05-07-2018, 02:15 PM
    14 responses
    1,788 views
    0 likes
    Last Post aligator  
    Started by Jimmyk, 01-26-2018, 05:19 AM
    6 responses
    837 views
    0 likes
    Last Post emuns
    by emuns
     
    Started by jxs_xrj, 01-12-2020, 09:49 AM
    6 responses
    3,291 views
    1 like
    Last Post jgualdronc  
    Started by Touch-Ups, Today, 10:36 AM
    0 responses
    11 views
    0 likes
    Last Post Touch-Ups  
    Started by geddyisodin, 04-25-2024, 05:20 AM
    11 responses
    62 views
    0 likes
    Last Post halgo_boulder  
    Working...
    X