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

Add a button to chart trader

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

    Add a button to chart trader

    Hey guys,

    This is a beginner question so please bear with me. I wanted to ask if this was possible:

    1. Add button(s) to Chart Trader that places a Buy/Sell Stop below the current candle's Low/High

    2. Configure a hotkey combination to accomplish the same thing

    Is this possible? I'll have to hire a programmer to do the work but wanted to ask if this can be done first.

    Thanks!

    #2
    Hello PN720,

    Yes, it is possible to submit an order from a button click.

    Below is a link to a script that demonstrates this.
    I need some guidance. I need to create a script that has 3 plots that are public and they plot either a 1 or 0. But I need to create another indicator that has 3 chart buttons that sets these variables. The first indicator needs to get those values from the second indicator depending on the button clicks. Because of using


    Also, below is a link to some examples of modifying wpf elements of a chart.
    https://ninjatrader.com/support/foru...327#post499327

    Custom hot keys are not supported by NinjaTrader but it may be possible to accomplish this with unsupported code. Below is a link to a forum post you may find helpful.
    https://ninjatrader.com/support/foru...688#post505688
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3


      this link does not bring me to a specific app. May you post updated link?

      Comment


        #4
        Hello leotancfa,

        Below is a link to this script on our User App Share.



        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.

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

        Comment


          #5
          NinjaTrader_Jim

          Could you post a directly downloadable zip file because once again, the download links in the User Share "library" do not work, I've tried on 3 different browsers. Thank you.

          Comment


            #6
            Hello EminiTrader,

            I am having no difficulty downloading from the link in post #4. We'll need more information to find out why you're unable to download from our Ecosystem site. Please answer all of the following questions:
            • What version of Windows are you using?
            • What web browser are you using?
            • Does this symptom persist if your clear your browser's cache?
            • What about if you use a different web browser?
            • What about after you turn off your PC, turn off your modem/router for at least 30 seconds, then restart your PC?
            If you are still unable to download, please provide this information and then we can post the strategy here.

            We look forward to your reply.
            JimNinjaTrader Customer Service

            Comment


              #7
              Hello brownsfan019,

              The strategy adds buttons to the chart. The buttons set a bool which then is checked in the script's OnBarUpdate method to fire a market order. The script is meant as a demonstration for adding buttons for manual order placement in a strategy, but the script is open source and the implementation can be programmed to your liking.

              We look forward to assisting.
              JimNinjaTrader Customer Service

              Comment


                #8
                I tried to import this and it succesfully imported but how do you use it? I don't see buttons on a chart. Do you have to enable the strategy? I just want to add a custom button to the chart trader panel that i can click to perform a task like buy/sell contract.

                Comment


                  #9
                  Hello bc24fl,

                  Yes, you have to enable the strategy.

                  If you want to consider another approach, You can create an indicator like the ones linked below and then use AddOn Framework code to submit orders. This would be a more advanced approach, and it may be easier to move forward using a strategy.

                  Modifications to chart WPF elements and tab considerations - NinjaTrader Support Forum

                  Account.Submit() - https://ninjatrader.com/support/help...nt8/submit.htm

                  We look forward to assisting.
                  JimNinjaTrader Customer Service

                  Comment


                    #10
                    I've done the following in this order:

                    1. Import ninjascript addon .zip file. NT says "succesfull"
                    2. Load & Enabled strategy
                    2. Open new chart.
                    3. Click chart trader button on chart to display buttons.

                    On the chart trader panel i do not see "Long" or "Short" buttons. Is there a step I'm missing?
                    Last edited by bc24fl; 07-23-2020, 01:16 PM.

                    Comment


                      #11
                      Hello bc24fl,

                      The strategy adds the buttons to the chart in the upper right corner. If you would like to add buttons to Chart Trader, please see the examples linked in post #10.

                      Click image for larger version

Name:	190614448492323951.png
Views:	2653
Size:	18.5 KB
ID:	1111005
                      We look forward to assisting.
                      Attached Files
                      JimNinjaTrader Customer Service

                      Comment


                        #12
                        That link for WPF worked. Question, since i need to use the Account.submit method, how can i get access to the currently selected account. The docs show (see code below) I can loop through each account but I'd like to get the currently selected account for that particular chart. Is this possible?

                        foreach (Account sampleAccount in Account.All)
                        Print(String.Format("The account {0} has a {1} unit FX lotsize set", sampleAccount.Name, sampleAccount.ForexLotSize));

                        So whether I'm using playback or a real account, I'd like it to default to what the chart trader panel is using.

                        Thanks.

                        Comment


                          #13
                          Hello bc24fl,

                          This isn't documented, but you could consider using ChartControl.OwnerChart.ChartTrader.Account for the Account, and it will reflect the account selected in ChartTrader.

                          We look forward to assisting.
                          JimNinjaTrader Customer Service

                          Comment


                            #14
                            I have had nightmares trying to get this to work - I have the buttons. It will work once and then just stops. It would be helpful if you could just provide some basic code eg onbuttonclick - what the enter order or submit order is.
                            I have coded on and off since 2012 but NT8 is just a stretch too far - everything is super complicated to a non coder.
                            I spend hours going round and round.

                            Comment


                              #15
                              Mindset, I have one I just finished last night that works well. I have to run but will post in the afternoon with instructions. NinjaTrader_Jim, that worked perfectly thanks.

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by Mizzouman1, Today, 07:35 AM
                              4 responses
                              18 views
                              0 likes
                              Last Post Mizzouman1  
                              Started by philmg, Today, 01:17 PM
                              1 response
                              6 views
                              0 likes
                              Last Post NinjaTrader_ChristopherJ  
                              Started by cre8able, Today, 01:01 PM
                              1 response
                              7 views
                              0 likes
                              Last Post NinjaTrader_ChelseaB  
                              Started by manitshah915, Today, 12:59 PM
                              1 response
                              5 views
                              0 likes
                              Last Post NinjaTrader_Erick  
                              Started by ursavent, Today, 12:54 PM
                              1 response
                              6 views
                              0 likes
                              Last Post NinjaTrader_Jesse  
                              Working...
                              X