Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Retrieving Currency Rates

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

    Retrieving Currency Rates

    Hi there,

    My Sim101 account is in British Pounds. When trading a foreign asset like Germany30 (denominated in Euros), I noticed that the executions table provides the current EURGBP rate, which was used to convert my profit from Euros into British pounds to display the correct PNL in British Pounds on the Accounts tab.

    Click image for larger version  Name:	image_2021-02-25_112301.png Views:	0 Size:	34.3 KB ID:	1143529

    I was wondering how Ninjatrader retrieves this information and is there any way for me to get access to current exchange rate information programmatically?

    I note there are a number of CurrencyRequest classes, but I'm not sure how to use them. Any advice for retrieving these rates would be greatly appreciated.

    Click image for larger version  Name:	image_2021-02-25_112518.png Views:	0 Size:	9.7 KB ID:	1143531
    Attached Files

    #2
    Hello kevinenergy, thanks for writing in.

    NinjaTrader uses either a currency pair or a currency futures instrument to get the conversion rate. To get the conversion rate programmatically, add an "EURGBP" series to your script with AddDataSeries, then you can reference the price of EURGBP to convert the price in real time.

    https://ninjatrader.com/support/help...dataseries.htm - AddDataSeries()

    https://ninjatrader.com/support/help...nstruments.htm - multi time frame and instrument overview

    Please let me know if you have any questions on this material

    Comment


      #3
      Hi Chris thanks for your response and the information.
      It's actually an Addon I'm working with, so I don't think AddDataSeries is compatible.
      Is there any other way?

      Thanks for your support!

      Comment


        #4
        Hello kevinenergy, thanks for your reply.

        Yes, you can do this in an Addon. We have a full example of the functionalities of an Addon here that you can download, see the commented section "// When user presses the Realtime Data button"

        This will show you how to do a bars request to get the real time data of any instrument.

        https://ninjatrader.com/support/help...t_overview.htm - Download on this page

        Kind regards.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        571 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        330 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        101 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        548 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        549 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X