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

NT Questions 2

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

    NT Questions 2

    1. Is there an account object that is accessible from a strategy that holds account info?
    Type (1k, 10, 100k), balance, etc

    2. Is there a collection of open positions?

    3. Is there a collection of instruments? I'm looking for margin requirements based on the account type and current commission\spread.

    4. Instrument list: I only trade currencies and I have an instrument list. Can I hide all other markets?

    #2
    Hello GibbsB613, and thank you for your questions.

    1. Is there an account object that is accessible from a strategy that holds account info?
    Type (1k, 10, 100k), balance, etc
    There is. You can learn more about the Account object here,



    Be sure to check out the Get method of the Account object for the type of information you mentioned.

    2. Is there a collection of open positions?
    Yes. The Account object mentioned previously will let you access account-wide position information. For strategy managed positions, you will want to review the Positions member,



    3. Is there a collection of instruments? I'm looking for margin requirements based on the account type and current commission\spread.
    To review instruments currently used by the script, including the information you requested, you will want to review the Instruments member,



    4. Instrument list: I only trade currencies and I have an instrument list. Can I hide all other markets?
    Every one of your instrument lists will always be available from the Instrument Selector. This said, if you would like to remove an instrument from your 6 most recently used instruments section, or remove a pinned instrument, simply hover over it with your mouse and press the delete key on your keyboard.

    Please let us know if there are any other ways we can help.
    Jessica P.NinjaTrader Customer Service

    Comment


      #3
      For question # 2, how do I see open unmanaged positions?

      Another question, how do I add a 4H moving average on a 1H chart? I do have both dataseries on the chart since I'm viewing MTF.

      Thanks,

      Comment


        #4
        Unmanaged positions will need to be tracked by you as the developer. I would like to recommend storing references to order objects in a Dictionary.

        I appreciate your patience, but just so I can make sure I am providing accurate advice, can you explain what is meant by 1H and 4H? I prefer asking and being sure rather than guessing even if I feel as though I may know what these mean.
        Jessica P.NinjaTrader Customer Service

        Comment


          #5
          No worries, it should've been H1 and H4, which means one hour and four hour charts respectively.

          "I would like to recommend storing references to order objects in a Dictionary." I'm not sure what you mean by this. Does this mean NJ won't have any data on my positions available?

          Comment


            #6
            Thanks for the clarification. Let's say your primary series (the one you passed into your chart) was your 1 hour bars, and the first series you created with AddDataSeries was your 4 hour bars. These then would be your 1 hour and 4 hour SMAs

            SMA(BarsArray[0], period1)
            SMA(BarsArray[1], period2)

            With respect to unmanaged orders, the rational is that once you have decided to manage your orders, Ninja takes a hands off approach. As such, your strategy won't keep track of the positions you've taken. This information is available in other contexts - attached to your Account object, for instance; there are various items such as this item which lets your strategy view your account position directly that you can find searching the help guide



            But as far as having a collection of your strategy's positions made available, this is only something Ninja will do for you if you are using managed order entry. This said, with unmanaged order entry, since you will need to keep reference objects to compare against in OnExecutionUpdate and OnOrderUpdate anyway, you have all the information you need to keep track of these orders and positions however you see fit and you are not restricted by any decisions the NinjaTrader programmers may have made.
            Jessica P.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by bmartz, 03-12-2024, 06:12 AM
            4 responses
            31 views
            0 likes
            Last Post bmartz
            by bmartz
             
            Started by Aviram Y, Today, 05:29 AM
            4 responses
            12 views
            0 likes
            Last Post Aviram Y  
            Started by algospoke, 04-17-2024, 06:40 PM
            3 responses
            28 views
            0 likes
            Last Post NinjaTrader_Jesse  
            Started by gentlebenthebear, Today, 01:30 AM
            1 response
            8 views
            0 likes
            Last Post NinjaTrader_Jesse  
            Started by cls71, Today, 04:45 AM
            1 response
            7 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Working...
            X