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

Window Tracking Performance Data

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

    Window Tracking Performance Data

    Hello,

    My goal is to have a NTWindow w/ selector of an Account. In the Add On after the Account is selected would first Display Account Data, BuyingPower / Performance / etc.
    Then By Instrumment.Strategy (Variables Generated in the Strategy) current In-Out Amount / Current Quantity Held / etc. On Close of NT8 save off data for next startup.

    What key considerations must I consider?

    Best regards,
    GTBrooks

    #2
    Hello GTBrooks,

    Thank you for the post.

    In this case, you could find a good portion of the items you have mentioned in the addon sample we have at the following link:



    Specifically, the file listed as "Download AddOn Framework NinjaScript Basic file to your desktop"

    In this sample, it shows the required syntax to create an Instrument selector, Account selector, subscribes to data and account metrics, place orders and other actions including persistence. This is a complete addon sample, in combination with the help guide addon section this describes the majority of what is possible.

    After reviewing the sample, if you have further questions related to any of the items please let me know.

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      That is the majority of it, but ...

      NinjaTrader_Jesse,

      Thank you, there is a lot of very useful NinjaScript that I can re-purpose.

      There is still one issue that I think I will run into.
      AddOn 1 = Collects and holds in Var form All Strategies Trading on Sim101 account (Strategies trading on Sim will make Var available for Addon To store (Trade Performance by Instrument-Strategy))
      AddOn 2 = Collects and holds in Var form All Strategies Trading on Real Time account (Strategies trading on Sim will make Var available for Addon To store (Trade Performance by Instrument-Strategy))
      AddOn 3 = Rosetta Stone (a) Instrument-Strategy (Sim) (If Instrument-Strategy (Trading > Par) on all 5 built-in Performance metrics = True) (b) Instrument-Strategy (Real-Time) see's Sim is profitable enough to allowed to trading.
      note: All performance Metrics in Real-Time not Historical.

      .or. is there a way to do this in 1 AddOn?
      Last edited by GTBrooks; 09-27-2017, 02:54 PM.

      Comment


        #4
        Hello,

        Thank you for the reply.

        I am not certain I could answer the question from these details. You specified that these concepts should be in 3 addons, the answer to this question, if they can be merged, this would depend on the logic you used.

        You would need to determine this from your end, there is nothing I could really mention that will specifically prevent you from using only 1 addon. It really depends if your logic can all be placed in one addon.

        As you are using C# for the programming language, you are free to separate the addon as needed I.E. making custom classes or structure it however you want that works with what you are trying to do.

        I generally suggest to start simple, or start with the sample and build off of it. Try your idea in the sample and see if you run into any roadblocks. Addons are a very large subject which I'm sure there are many ways to accomplish different tasks. So long as you are using the methods in the addon guide to interface with the platform, you can for the most part structure your script however you want.

        The sample gives a general idea on how to do most basic items like appending a menu item, creating a window etc. Outside of that, your logic can be formed how you want, the examples are more or less just a guide on how to interact with NinjaTrader.

        If you are planning to use multiple addons, you would likely need to make a way for them to communicate. You could review using a Static class if you want to do that: https://ninjatrader.com/support/foru...24&postcount=3

        I look forward to being of further assistance.
        JesseNinjaTrader Customer Service

        Comment


          #5
          I currently have been able to generate Variables With my Strategies;
          [AccountInstrumentStrategy] = True.
          To look the Variables up on the AddOn side I will need to make an Object that puts together 3 lists (already worked out how to put them together). I have a way to Get Accounts Connected and Strategies traded on the Accounts.
          I need to know the Instruments traded on the Account & how would you generate a list of Instruments on the Account in an AddOn?

          Goal = List 1 (Account) + List 2 (Instrument) + List 3 (Strategy) = Lookup strategy var (True/False)

          Comment


            #6
            Hello,

            Thank you for the reply.

            I am unsure I understand the question here in full but was able to pick out that you asked: "I need to know the Instruments traded on the Account". You can locate orders to the account by using the Account object its self and looking at the various collections the account has.

            You can see the various collections available here: https://ninjatrader.com/support/help...ount_class.htm

            You could use the Orders or Executions collections to know what has been traded on an account and then check the Instrument of that order/execution to know where it should be paired. You can also view active positions using the Position object.


            Please let me know if I may be of further assistance.
            JesseNinjaTrader Customer Service

            Comment


              #7
              Thank you for the response.

              It looks like I might be able to use https://ninjatrader.com/support/help...ount_class.htm to get trade collection information broken out by Account & Strategy, but NOT instrument. If I could use the Trade Collection to get performance metrics of strategies trading on a given instrument. I would NOT need a AddOn, it would all be able to be done in the Strategy itself. this would simplify things for me.

              How could I pull Account Trade Collection information & break it into Strategies trading on 1 instrument?
              Then taking that information and rank trade performance broken out by Strategy?
              Finally ranking the Strategy position over all strategies trading on a given instrument?

              Comment


                #8
                Hi GTBrooks, thanks for your follow up.

                The Account object can be used in Addons, Strategies, and Indicators. Just set up the Account object like the example on this page:



                With the account object you can get all Order, Executions, and AccountItems for the selected account.

                Please let me know if I can assist any further.
                Chris L.NinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by algospoke, Yesterday, 06:40 PM
                2 responses
                19 views
                0 likes
                Last Post algospoke  
                Started by ghoul, Today, 06:02 PM
                3 responses
                14 views
                0 likes
                Last Post NinjaTrader_Manfred  
                Started by jeronymite, 04-12-2024, 04:26 PM
                3 responses
                45 views
                0 likes
                Last Post jeronymite  
                Started by Barry Milan, Yesterday, 10:35 PM
                7 responses
                21 views
                0 likes
                Last Post NinjaTrader_Manfred  
                Started by AttiM, 02-14-2024, 05:20 PM
                10 responses
                181 views
                0 likes
                Last Post jeronymite  
                Working...
                X