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

NinjaScript: Symbol for Currency

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

    NinjaScript: Symbol for Currency

    Is there a NinjaScript function that returns a Currency's symbol?

    In particular, I'm accessing currency configured for an instrument through Bars.Instrument.MasterInstrument.Currency.

    I wish to display this currency in its equivalent currency sign or three-character ISO 4217 currency symbol:
    UsDollar ==> $ or USD
    Euro ==> € or EUR
    BritishPound ==> £ or GBP
    etc.

    Is there a way through NinjaScript coding?

    Kind Regards
    Vivek
    Last edited by engrvivs; 06-23-2016, 12:41 AM.

    #2
    Hello Vivek,

    Thank you for your post.

    You would override ToString(). For example:
    Code:
    		public override string ToString()
    		{
    			if (Instrument.MasterInstrument.Currency.ToString() == "Euro")
    				return "€";
    			else
    				return Name;
    		}

    Comment


      #3
      Thanks Patrick for the response!

      So, this means I need to create whole if-else series for all allowed "Currency" in NT.

      Where can I find all possible NT "Currency" values, so that I can create such a function?

      Kind Regards
      Vivek

      Comment


        #4
        Hello Vivek,

        Thank you for your response.

        Go to Tools > Instrument Manager > select any instrument > Edit > then left click on the Currency. All available currencies will be listed here.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by 00nevest, Today, 02:27 PM
        0 responses
        1 view
        0 likes
        Last Post 00nevest  
        Started by Jonafare, 12-06-2012, 03:48 PM
        5 responses
        3,986 views
        0 likes
        Last Post rene69851  
        Started by Fitspressorest, Today, 01:38 PM
        0 responses
        2 views
        0 likes
        Last Post Fitspressorest  
        Started by Jonker, Today, 01:19 PM
        0 responses
        2 views
        0 likes
        Last Post Jonker
        by Jonker
         
        Started by futtrader, Today, 01:16 PM
        0 responses
        9 views
        0 likes
        Last Post futtrader  
        Working...
        X