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

Add On Website data stream, automatically update Margin Requirements

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

    Add On Website data stream, automatically update Margin Requirements

    The goal is to download the streaming data from https://www.forex.com/en-us/support/...ip-calculator/ with ALL being selected. This would give me access to the Margin requirements at any given moment. This would provide the input data that needs to be tracked and analyses. This step will allow me to automatically update MyRiskTemplate with up to date data (time stamped) it can determine the max margin required in the past blank amount of updates. This would provide the Risk template with the data needed to update hurtle rate in the account being traded.

    Big picture some of the base components to do this is already available in NinjaTrader 8 but I am missing on how to get up to date data from https://www.forex.com/en-us/support/...ip-calculator/

    any help would be appreciated

    #2
    Looks like you'll have to download 1-2 json files with something like
    https://docs.microsoft.com/en-us/dot...tframework-4.8
    parse them, merge the sets, and do minor calculations and you are done. Simple as that.
    Most likely the MinLeverage property aka Margin% will be enough.
    Attached Files
    Last edited by MojoJojo; 04-08-2020, 02:12 AM.

    Comment


      #3
      Hello GTBrooks,

      If that site offers some kind of API you could look into using that. What MojoJojo has pictured is the page's web requests which may be able to be used to collect their internal urls which that site uses however those may change and you would also likely need to process the data. You can refer to the site you linked and email their support to see if they have some kind of way to access their data that you can use, otherwise if you can find the data you need and have a way to access it you could certainly look for ways to gather that data from C#.

      You would be best off searching online in general for how to access that data depending on what you end up with. If they provide the data as files or if you access the raw data as mojojojo implied you could likely parse the files in a C# way. An example google search could be "C# download and parse json file" which will provide some examples which could then be used in your addon. If they have some kind of web api you could search online for C# tutorials related to that type of api access in C#.

      NinjaScript is simply C# 4.5 so you can execute any C# tasks from within your addon to collect or parse the data, it really just depends on what format that data is in and what is required to access it.

      Please let me know if I may be of additional assistance.
      JesseNinjaTrader Customer Service

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by bortz, 11-06-2023, 08:04 AM
      47 responses
      1,606 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
      13 views
      0 likes
      Last Post Javierw.ok  
      Working...
      X