• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

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 sohailashraf, Yesterday, 10:18 PM
            0 responses
            4 views
            0 likes
            Last Post sohailashraf  
            Started by jjnc2006, Yesterday, 07:36 PM
            0 responses
            9 views
            0 likes
            Last Post jjnc2006  
            Started by futurenick, Yesterday, 06:26 AM
            1 response
            12 views
            0 likes
            Last Post nkhoi
            by nkhoi
             
            Started by NinjaCustomer, Yesterday, 12:29 PM
            2 responses
            10 views
            0 likes
            Last Post NinjaCustomer  
            Started by Steve L, Yesterday, 11:32 AM
            0 responses
            8 views
            0 likes
            Last Post Steve L
            by Steve L
             
            Working...
            X