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

How to collect a string

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

    How to collect a string

    Good morning,
    I would want to know, is it possible to collect a string from a fullName Please?
    For example:
    I work on eur/usd and I tests a strategy on this pair, the instrument.fullName will be eur/usd.
    So, in this strategy I want to do a calcul on aud/usd and for this I would want to collect the 3 last letters on the right of the fullName.
    How can I do this please?

    Thank's a lot for your answer and your time.

    #2
    Hello,

    This can be done with string modification:
    Learn about strings in C# programming. See information on declaring and initializing strings, the immutability of string objects, and string escape sequences.



    Please note, I'm unsure as to whether or not you're doing this in OnBarUpdate() or Initialize(). If you're passing in dynamic strings to Initialize() please keep in mind that this is not supported by us as it can lead to unexpected results since Initialize() can be called other times than when starting the strategy/indicator.

    Let me know if I can be of further assistance.
    LanceNinjaTrader Customer Service

    Comment


      #3
      Originally posted by neo-13 View Post
      Good morning,
      I would want to know, is it possible to collect a string from a fullName Please?
      For example:
      I work on eur/usd and I tests a strategy on this pair, the instrument.fullName will be eur/usd.
      So, in this strategy I want to do a calcul on aud/usd and for this I would want to collect the 3 last letters on the right of the fullName.
      How can I do this please?

      Thank's a lot for your answer and your time.
      Methinks you are looking for the Substring() method.

      ref: http://msdn.microsoft.com/en-us/library/aka44szs.aspx

      Comment


        #4
        Thank's so much at you two.
        Koganam, your post is exactly that I search.

        Thank's.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Taddypole, 04-26-2024, 02:47 PM
        1 response
        10 views
        0 likes
        Last Post NinjaTrader_Eduardo  
        Started by futtrader, 04-21-2024, 01:50 AM
        6 responses
        58 views
        0 likes
        Last Post futtrader  
        Started by sgordet, Today, 11:48 AM
        0 responses
        4 views
        0 likes
        Last Post sgordet
        by sgordet
         
        Started by Trader146, Today, 11:41 AM
        0 responses
        5 views
        0 likes
        Last Post Trader146  
        Started by jpapa, 04-23-2024, 07:22 AM
        2 responses
        19 views
        0 likes
        Last Post rene69851  
        Working...
        X