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

Modifying the Add Buttons to SuperDOM code

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

    Modifying the Add Buttons to SuperDOM code

    Hello,

    I am very interested in adding custom buttons to my SuperDOM and came across a few addons:

    Add Buttons to the SuperDOM: referred to as “SuperDOM Add-On” in my questions below


    Buy Sell buttons on the chart: referred to as “Chart Button Strategy” in my questions below


    I have a few questions about the codes with which I would very much appreciate your help:

    1. Rows 245 through 255 of the SuperDOM Add-On appear to be where one would put the actions that you want to occur when the buttons are pressed [I’ve included for Button 3 although Button 3 is optional in the layout]. Examples of actions one could program include “buy limit at bid.” Are my assumptions correct?

    2. In the Chart Button Strategy, however, there is the more familiar “if” approach within OnBarUpdate for the button logic. Why couldn’t I use this approach for the SuperDOM Add-On?

    3. Rows 93-100 of the SuperDOM Add-On spell out with “//” steps for naming and assigning a tag. Why would I need to assign a tag?

    4. Rows 43-46 of the SuperDOM Add-On are for “State.Terminated” but are blank. I’m not really sure how one would go about terminating buttons in a SuperDOM, but I presume that if one could do that, this is where you would place the coding to remove the buttons. Is that correct?

    Also, I have a few questions about making modifications to the buttons in SuperDOM Add-On code:

    A. Is it possible to make the buttons go laterally like this “1” “2” “3” rather than horizontally like
    “1”
    “2”
    “3”
    ?

    B. I have read about drop-down menus in c#. Let’s assume there’s a button for a “buy limit order.” Could I create a menu with numbers such as “2, 4, 6, 8” that correspond to ticks below the bid in order to send a custom buy limit order? If you could point me in the correct direction on this, I would be very grateful.

    Thanks a lot, look forward to your responses!


    #2
    Hello catinabag,

    As a heads up, this indicator is uses the Addon style and injects buttons into all open SuperDOM windows. Technically it is not specifically a SuperDOMColumn or an indicator (that would be added to individual SuperDOMs).


    Yes, the methods on lines 245 to 255 are likely meant to be .Click event handler methods. These should be assigned to the button's .Click, similar to LONGSHORTToolbarButtonsB9 assigning these method handlers on lines 87 and 88 to the event handler on lines 145 to 179.

    The LONGSHORTToolbarButtonsB9 sets a bool that gets checked later in OnBarUpdate(). The Addon style that adds these buttons to the SuperDOM does have an OnBarUpdate(). If this script was an indicator instead of an addon it would have a native OnBarUpdate().

    Alternatively, the Addon can use a BarsRequest to request data and start a real-time stream by assigning a handler to the .Update() event.


    The tag doesn't have to be set. If you want to use the tag to identify the button this might be one reason the tag might be set.


    The State.Terminated of an Addon is different than an indicator or SuperDOMColumn script as this script wouldn't be terminated until NinjaTrader is shutdown, or a compile event occurs.
    Normally, State.Terminated would be where button event handlers would be removed.
    However, in an Addon, this would need to be done on a per SuperDOM window basis, in the OnWindowDestroyed(). In SuperDomButtons this is the Cleanup() method that is run.

    Try using \r\n in the string for the button content.


    Yes, you can put numbers in drop-downs.

    Below is a link to the ChartCustomToolBarExample_NT8 examples which has custom drop-downs.
    Hello All, Moving forward this will be maintained in the help guide reference samples and no longer maintained on the forum. Creating Chart WPF (UI) Modifications from an Indicator - https://ninjatrader.com/support/help...ui)-modifi.htm (https://ninjatrader.com/support/helpGuides/nt8/creating-chart-wpf-(ui)-modifi.htm) I've
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Thank you very much!

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by alifarahani, Today, 09:40 AM
      6 responses
      31 views
      0 likes
      Last Post alifarahani  
      Started by Waxavi, Today, 02:10 AM
      1 response
      17 views
      0 likes
      Last Post NinjaTrader_LuisH  
      Started by Kaledus, Today, 01:29 PM
      5 responses
      14 views
      0 likes
      Last Post NinjaTrader_Jesse  
      Started by Waxavi, Today, 02:00 AM
      1 response
      12 views
      0 likes
      Last Post NinjaTrader_LuisH  
      Started by gentlebenthebear, Today, 01:30 AM
      3 responses
      17 views
      0 likes
      Last Post NinjaTrader_Jesse  
      Working...
      X