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

Show winning/losing trades on DOM

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

    Show winning/losing trades on DOM

    Hi, I would like to show total winning/losing trades on the dom for the instrument thats currently loaded. Is this possible?

    For example I have 2 dom instances. 1 is /CL and the other is /ES and I would like to show the counts separately.

    Questions:
    a. How do I access the winning/losing trades for an instrument?
    b. Can I show this info on the DOM using an addon?

    #2
    Hello trader252,

    Thanks for your post.

    We do not have a supported means to access historical trades from the NinjaTrader database, but we do allow you to monitor Account level position updates and executions. You could use the Account Position Update and Execution Update events to look for some specific instruments and start building this information from trades made with realtime data. However, we could not offer a means to build this information by accessing the NinjaTrader database for historical trades through NinjaScript.

    Account.PositionUpdate - https://ninjatrader.com/support/help...tionupdate.htm

    Account.ExecutionUpdate - https://ninjatrader.com/support/help...tionupdate.htm

    We are tracking interest behind providing NinjaScript methods for access to the NinjaTrader database with the ticket ID SFT-1540. I have added a vote on your behalf. Feature request interest is tracked by votes before implementation is considered, so we cannot offer an ETA or promise of fulfillment.

    To answer your second question, presenting this information could be done from a custom SuperDOMColumn. You may check the Volume and APQ SuperDOMColumns for reference on how a custom SuperDOM column can be made.

    SuperDOMColumn Help Guide reference can be found here - https://ninjatrader.com/support/help...dom_column.htm

    Please let me know if there is anything else I can do to help.
    JimNinjaTrader Customer Service

    Comment


      #3
      Is there another possible way to display in the dom besides using a column? Maybe near the Reverse/Close buttons?

      Comment


        #4
        Hello trader252,

        Yes, this would be possible by making WPF modifications to the SuperDOM. As these modifications would be WPF and not be using an area involving SharpDX rendering, the OnRender code that is used in the SuperDOMColumns cannot be used in the same way. The grid layout also is not locked into documentation, so experimenting would be needed before adding new columns/rows where you like. The implementation will also need to be checked if there are updates to NinjaTrader that break these modifications.

        An example that performs WPF modifications to the SuperDOM can be found here - https://ninjatraderecosystem.com/use...s-to-superdom/

        The NinjaTrader Ecosystem website is for educational and informational purposes only and should not be considered a solicitation to buy or sell a futures contract or make any other type of investment decision. The add-ons listed on this website are not to be considered a recommendation and it is the reader's responsibility to evaluate any product, service, or company. NinjaTrader Ecosystem LLC is not responsible for the accuracy or content of any product, service or company linked to on this website.

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

        Comment


          #5
          I was able to use the provided code to modify the SuperDom, however it only affects the current tab. How can I get it to modify all current and future SuperDom tabs?

          Comment


            #6
            Hello trader252,

            From an AddOn, you can subscribe to the SuperDom.MainTabControl.SelectionChanged event to add/remove buttons to additional tabs.

            I don't have any additional example code that can show you how to do this and the approach will take a little bit of experimenting since these modifications are not technically documented/supported. That said, my colleague Chelsea has some excellent examples for performing WPF modifications to charts. His samples properly handle tab changing events, so his samples may be helpful to see how you can use the SelectionChanged events to accomplish your goal. Keep in mind, further logic will have to be included to keep track of which tabs have your buttons added so you can properly handle removing and adding new buttons.

            Below is some example code showing how the SuperDom's MainTabControl.SelectionChanged event can be subscribed. This should be unsubscribed in the AddOn's Cleanup method.

            Code:
            private NinjaTrader.Gui.SuperDom.SuperDom MyDom;
            private System.Windows.Window MyWindow;
            
            protected override void OnWindowCreated(Window window)
            {            
            
                if (window != null)
                {
                    MyWindow = window;
            
                    if (MyWindow is NinjaTrader.Gui.SuperDom.SuperDom)
                    {
                        MyDom = MyWindow as NinjaTrader.Gui.SuperDom.SuperDom;
                        MyDom.MainTabControl.SelectionChanged += TabChangedHandler;
                    }
                }
            }
            Chelsea's examples can be found here - https://ninjatrader.com/support/foru...considerations

            Please let me know if we can be of further assistance.
            JimNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by geddyisodin, Today, 05:20 AM
            2 responses
            16 views
            0 likes
            Last Post geddyisodin  
            Started by hazylizard, Today, 08:38 AM
            0 responses
            6 views
            0 likes
            Last Post hazylizard  
            Started by Max238, Today, 01:28 AM
            5 responses
            42 views
            0 likes
            Last Post Max238
            by Max238
             
            Started by giulyko00, Yesterday, 12:03 PM
            3 responses
            13 views
            0 likes
            Last Post NinjaTrader_BrandonH  
            Started by habeebft, Today, 07:27 AM
            1 response
            16 views
            0 likes
            Last Post NinjaTrader_ChristopherS  
            Working...
            X