Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to remove buy/sell buttons and order placement on SuperDOM functionality

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

    How to remove buy/sell buttons and order placement on SuperDOM functionality

    Alright, so let's just get this out of the way: Yes, I know it's dumb, yes I should have better self-control and discipline; I'm aware and I'm working on it. That's why I'm making this post - realizing you have a problem is step 1, right?

    Backstory: In the past I've been foolish and made terrible, emotional buys and sells using the superDOM instead of letting my automated NT8 Strategies do their thing. I have automated strategies to enter and exit the market at various times and situations which work, but I tilt easily if I take too many losses in a short time and lose money through mashing the market buy and market sell buttons on the bottom of the DOM in desperation and also through placing buy/sell limit/stop orders on the superDOM ladder itself.

    Basically, I feel it's in my best interest to simply remove the option to screw myself over, which leads me to the topic of my post: is it possible to remove buy/sell buttons and order placement functionality on the superDOM in NT8? Either through options or code, I just need to stifle/remove the temptation to try and time the market outright when I should just be letting my automation do the trades for me.

    Any help from users or NT support would be appreciated, or just laugh at me for being an idiot, either one.

    #2
    Hello ckabjp,

    Thank you for your post.

    Basically yes, that would be possible with code, though this gets pretty deep into unsupported territory. This would require looping through and finding the buttons you want to remove. Finding these items is unsupported and subject to change. It's also not really something we would recommend, as affecting the overall normal GUI can be bad in case you need to manage your account or for some reason the addon stops working.

    That being said, we have a script available on our User App Share that shows how to add buttons to the SuperDOM that could be modified to remove buttons:

    https://ninjatraderecosystem.com/use...s-to-superdom/

    It should be noted that this requires more advanced C# knowledge than your average simple indicator or strategy.

    You could use Inspect to get the AutomationIDs you would need to get the buttons. Here's a link to a forum post that goes over how to use Inspect to find those:

    https://ninjatrader.com/support/foru...gy?postcount=7

    Again, this would all be unsupported, but as I mentioned, technically possible.

    I will also submit a feature request for a view-only SuperDOM option that would allow you to monitor but would not allow order entry. Please note that while our development team does look at all feature requests, not all will make it into later releases of the software.

    Please let us know if we may be of further assistance to you.

    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.
    Kate W.NinjaTrader Customer Service

    Comment


      #3
      Thanks for the reply.

      Is it possible to make the buttons for buying and sell "invisible" by changing the color of the text and buttons themselves to match the background of the SuperDOM they're on?

      If not I think the best thing for me to do is simply adjust the dimensions of the superDOM to be covered or hidden by other windows completely, but that gets messy. I really wish there was a way to group the multiple windows (chart, control center, superDOM, etc) together so that I don't end up with like 15 different NT8 windows crowding my taskbar. Any word on that functionality?

      Comment


        #4
        Hello ckabjp,

        Thank you for your reply.

        The ability to change button text/color in the SuperDOM is currently pretty limited, but we do have a feature request for that at the moment that I can add a vote to for you.

        There is no current word on if/when we may see grouping or docking of windows together at this time.

        Please let us know if we may be of further assistance to you.
        Kate W.NinjaTrader Customer Service

        Comment


          #5
          Hello brownsfan019,

          Thank you for your reply.

          I've submitted that for our development team to look at. It can be tracked under SFT-4103.

          Please let us know if we may be of further assistance to you.
          Kate W.NinjaTrader Customer Service

          Comment


            #6
            Hi Kate,

            We now have the SuperDOMButtonsIndicator in the User App Share space (see attached screenshot below). The provided/posted indicator has provisions for two buttons (MyButton1 and MyButton2). I want to build on this indicator by making Button 1 and Button 2 to respectively trigger BUY MIT and SELL MIT orders. I suppose that the codes to do this should be in the portions/parts containing Print("MyButton 1 Click"), line 135 and Print("Button 2 Click"), line 140. Please, could you give the specific codes (and other related codes) for the BUY MIT and SELL MIT ? In addition I want to add more rows in the very near future to accommodate BUY STOP, SELL STOP and BREAK-EVEN triggers ... is this feasible ?

            Best Regards.

            omololu

            Click image for larger version

Name:	SuperDOMButtonsIndicator .png
Views:	639
Size:	27.9 KB
ID:	1169391



            Originally posted by NinjaTrader_Kate View Post
            Hello brownsfan019,

            Thank you for your reply.

            I've submitted that for our development team to look at. It can be tracked under SFT-4103.

            Please let us know if we may be of further assistance to you.

            Comment


              #7
              Hello omololu,

              Thank you for your reply.

              You would use Account.CreateOrder and Account.Submit to create and submit an order from the indicator:





              For an MIT order, the OrderType must be set to MIT:

              Code:
              Order myOrder = null;
              
              myOrder = myAccount.CreateOrder(myInstrument, OrderAction.Sell, OrderType.MIT, TimeInForce.Day, 1, 0, 1400, "myOCO", "stopOrder", null);
              
              myAccount.Submit(new[] { myOrder });
              As far as adding more rows, I'd take a look at line 100, 164, and 215 to see how the row was added and removed when the window is destroyed. You'd basically want to make another row in the same way, make a new button grid to hold your additional buttons, then follow the same general setup of adding the additional row and putting your additional buttons inside that.

              Please let us know if we may be of further assistance to you.
              Kate W.NinjaTrader Customer Service

              Comment


                #8
                Originally posted by NinjaTrader_Kate View Post
                Hello omololu,

                Thank you for your reply.

                You would use Account.CreateOrder and Account.Submit to create and submit an order from the indicator:

                https://ninjatrader.com/support/help...reateorder.htm

                https://ninjatrader.com/support/help...nt8/submit.htm

                For an MIT order, the OrderType must be set to MIT:

                Code:
                Order myOrder = null;
                
                myOrder = myAccount.CreateOrder(myInstrument, OrderAction.Sell, OrderType.MIT, TimeInForce.Day, 1, 0, 1400, "myOCO", "stopOrder", null);
                
                myAccount.Submit(new[] { myOrder });
                As far as adding more rows, I'd take a look at line 100, 164, and 215 to see how the row was added and removed when the window is destroyed. You'd basically want to make another row in the same way, make a new button grid to hold your additional buttons, then follow the same general setup of adding the additional row and putting your additional buttons inside that.

                Please let us know if we may be of further assistance to you.


                Thanks for your reply.

                So, I did the followings but I received the message: "Unhandled exception: Object reference not set to an instance of an object." when I click the Buttons. The indicator compiles but it sees that I'm missing somethings.

                public class SuperDOMButtonsIndicator : Indicator
                {
                .
                .
                .


                private Account myAccount;
                private Order entryOrder;

                .
                .
                .


                protected void Button1Click(object sender, RoutedEventArgs e)
                {
                Print("Button 1 Click");


                Order entryOrder;
                entryOrder = myAccount.CreateOrder(myInstrument, OrderAction.Buy, OrderType.MIT, TimeInForce.Day, 1, 0, 0, "myOCO", "stopOrder", null);
                myAccount.Submit(new[] { entryOrder });

                }

                protected void Button2Click(object sender, RoutedEventArgs e)
                {

                Print("Button 2 Click");


                Order entryOrder;
                entryOrder = myAccount.CreateOrder(myInstrument, OrderAction.Sell, OrderType.MIT, TimeInForce.Day, 1, 0, 0, "myOCO", "stopOrder", null);
                myAccount.Submit(new[] { entryOrder });

                }
                .
                .
                .
                .
                .
                ,


                In any case, could ChristL PLEASE give us full working codes example of this SuperDOMButtonsIndicator for MIT Buy and MIT Sell orders; we can consequently build on this full example.


                omololu

                Comment


                  #9
                  Hello omololu,

                  Thank you for your reply.

                  You're referring to myAccount.CreateOrder but I'm not seeing anywhere in the provided code where you're actually getting the account and assigning the Account to your account object:

                  https://ninjatrader.com/support/help...ount_class.htm

                  You'll need to initialize the account before you can reference Account.CreateOrder for that account - failure to do so would result in the error you're seeing when trying to create/submit orders.

                  Our examples both here and on the User App Share are provided as is and are meant as jumping off points for creating your own logic. It is against our policy to create, debug, or modify, code or logic for our clients. Basically, we cannot write your script for you.

                  A simple example of adding buttons to a chart that enter long or short positions or reverse the position may be found here that may be helpful to see how the account is initialized:

                  Hello everyone, I'm looking for an opportunity to access the command from the trader's chart to the Rev button This is the button that flips the position to the other side of the open In other words, I want to connect the ability to flip position to my custom buttons for example, this is how this command closes all orders:


                  The same concept could be carried over to adding buttons to the SuperDOM.

                  Please let us know if we may be of further assistance to you.
                  Kate W.NinjaTrader Customer Service

                  Comment


                    #10
                    Originally posted by NinjaTrader_Kate View Post
                    Hello omololu,

                    Thank you for your reply.

                    You're referring to myAccount.CreateOrder but I'm not seeing anywhere in the provided code where you're actually getting the account and assigning the Account to your account object:

                    https://ninjatrader.com/support/help...ount_class.htm

                    You'll need to initialize the account before you can reference Account.CreateOrder for that account - failure to do so would result in the error you're seeing when trying to create/submit orders.

                    Our examples both here and on the User App Share are provided as is and are meant as jumping off points for creating your own logic. It is against our policy to create, debug, or modify, code or logic for our clients. Basically, we cannot write your script for you.

                    A simple example of adding buttons to a chart that enter long or short positions or reverse the position may be found here that may be helpful to see how the account is initialized:

                    Hello everyone, I'm looking for an opportunity to access the command from the trader's chart to the Rev button This is the button that flips the position to the other side of the open In other words, I want to connect the ability to flip position to my custom buttons for example, this is how this command closes all orders:


                    The same concept could be carried over to adding buttons to the SuperDOM.

                    Please let us know if we may be of further assistance to you.
                    Hi Kate,

                    Yes, you are correct that I have not initialized the account in my script.

                    I'm not requesting that you "create, debug, or modify codes or logic" for me. In any case, I'm aware that you do render assistance to create(sometimes), debug, modify codes/logics for members here. I joined this forum in 2008 and the records are all over here where you render these assistance, and which we appreciate. From my experience, your examples on the User App and here seem to meet the functionalities specific to those examples ... it is sometime inundating to work with those examples, and that is the reasons for seeking your assistance here.

                    Meanwhile, I'll have a look at the links that you have provided and check which codes on Account Initialization could be useful. These links are not new to me ... I already have them in my browser Bookmarks.

                    omololu

                    Comment


                      #11
                      Originally posted by NinjaTrader_Kate View Post
                      Hello omololu,

                      Thank you for your reply.

                      You're referring to myAccount.CreateOrder but I'm not seeing anywhere in the provided code where you're actually getting the account and assigning the Account to your account object:

                      https://ninjatrader.com/support/help...ount_class.htm

                      You'll need to initialize the account before you can reference Account.CreateOrder for that account - failure to do so would result in the error you're seeing when trying to create/submit orders.

                      Our examples both here and on the User App Share are provided as is and are meant as jumping off points for creating your own logic. It is against our policy to create, debug, or modify, code or logic for our clients. Basically, we cannot write your script for you.

                      A simple example of adding buttons to a chart that enter long or short positions or reverse the position may be found here that may be helpful to see how the account is initialized:

                      Hello everyone, I'm looking for an opportunity to access the command from the trader's chart to the Rev button This is the button that flips the position to the other side of the open In other words, I want to connect the ability to flip position to my custom buttons for example, this is how this command closes all orders:


                      The same concept could be carried over to adding buttons to the SuperDOM.

                      Please let us know if we may be of further assistance to you.

                      Hi Kate,

                      The https://ninjatrader.com/support/foru...24#post1166424 link that you provided in your post #10 above confirms exactly what I was asserting in my last post ... you provided full functioning example script that works as-is for forum member memonolog. I'm requesting that ChristL provides a full functioning SuperDOMButtonsIndicator example script. My request is not for creating a new indicator. In any case, if my request does not have the same rightfulness as memonolog's, then you may wish to disregard it.

                      omololu

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by jaybedreamin, Today, 05:56 PM
                      0 responses
                      7 views
                      0 likes
                      Last Post jaybedreamin  
                      Started by DJ888, 04-16-2024, 06:09 PM
                      6 responses
                      18 views
                      0 likes
                      Last Post DJ888
                      by DJ888
                       
                      Started by Jon17, Today, 04:33 PM
                      0 responses
                      4 views
                      0 likes
                      Last Post Jon17
                      by Jon17
                       
                      Started by Javierw.ok, Today, 04:12 PM
                      0 responses
                      12 views
                      0 likes
                      Last Post Javierw.ok  
                      Started by timmbbo, Today, 08:59 AM
                      2 responses
                      13 views
                      0 likes
                      Last Post bltdavid  
                      Working...
                      X