• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.


No announcement yet.

Partner 728x90


Add On Website data stream, automatically update Margin Requirements

  • 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

    Looks like you'll have to download 1-2 json files with something like
    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.


      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


      Latest Posts


      Topics Statistics Last Post
      Started by waterman, Today, 07:02 PM
      0 responses
      1 view
      Last Post waterman  
      Started by authenticx, Today, 03:51 PM
      0 responses
      Last Post authenticx  
      Started by PN720, Today, 12:54 PM
      1 response
      Last Post NinjaTrader_Jim  
      Started by linuxguru, Yesterday, 05:59 PM
      1 response
      Last Post NinjaTrader_Kate  
      Started by xasser, Today, 02:17 PM
      3 responses
      Last Post xasser
      by xasser