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

Modifications to chart WPF elements and tab considerations

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

    #46
    Hello calebsandfort,

    You can use the addon approach to send orders with Atm Strategies attached. The addon approach works with any script type.
    http://ninjatrader.com/support/forum...555#post515555

    You could make it a strategy and then use EnterLong()/EnterShort in the buttons Click event handler method. Or you could set a variable that when set triggers an order being placed in a data driven method like OnBarUpdate().
    https://ninjatraderecosystem.com/use...bar-buttons-2/



    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.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #47
      Originally posted by NinjaTrader_ChelseaB View Post
      Hello calebsandfort,

      You can use the addon approach to send orders with Atm Strategies attached. The addon approach works with any script type.
      http://ninjatrader.com/support/forum...555#post515555

      You could make it a strategy and then use EnterLong()/EnterShort in the buttons Click event handler method. Or you could set a variable that when set triggers an order being placed in a data driven method like OnBarUpdate().
      https://ninjatraderecosystem.com/use...bar-buttons-2/



      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.
      Hi Chelsea

      Thanks for info. I've basically been able to implement what I want with a strategy and AtmStrategyCreate. I do have one question I'm hoping you might have some insight on. What I'm doing is submitting three limit orders at incremental limits. When I do this manually using Chart Trader it will make the second and third order use the profit and stop targets of the first order and group them together, which is what I want.

      However, when I do it via my strategy the stops/profit targets are separated out and not grouped together. Is there a way to get it to behave the same as when doing it via the chart trader?
      Attached Files

      Comment


        #48
        Hello calebsandfort,

        May I also have screenshots of the chartTrader.AtmStrategy.DisplayName (whatever may be selected) template in the Atm Strategy window to know what is set for the template?


        Chelsea B.NinjaTrader Customer Service

        Comment


          #49
          Originally posted by NinjaTrader_ChelseaB View Post
          Hello calebsandfort,

          May I also have screenshots of the chartTrader.AtmStrategy.DisplayName (whatever may be selected) template in the Atm Strategy window to know what is set for the template?

          Sure..here you go

          Comment


            #50
            Hello calebsandfort,

            I'm not understanding.

            The Atm Strategy Template doesn't have multiple targets and uses a quantity of 1.

            There should only be 1 entry and 1 exit.
            Chelsea B.NinjaTrader Customer Service

            Comment


              #51
              Originally posted by NinjaTrader_ChelseaB View Post
              Hello calebsandfort,

              I'm not understanding.

              The Atm Strategy Template doesn't have multiple targets and uses a quantity of 1.

              There should only be 1 entry and 1 exit.
              Say I enter at $2495. My profit target will be at $2496. Then the price drops to $2994 and I submit another order. So now my position size is 2 and the profit target for both is $2496 and stop is $2490 for both. That's how it works when I use chart trader.

              If I do it by placing the two orders via my strategy the profit targets and stops aren't in sync as they are with the chart trader, they're set relative to the entry price for each order.

              Comment


                #52
                Hello calebsandfort,

                That is correct.

                Chart Trader allows you to scale into an existing active Atm Strategy. Placing orders through code with Atm Strategy Methods does not allow for this, as there is no method for placing an order to an existing Atm Strategy. There is only AtmStrategyCreate which creates a new instance.
                Chelsea B.NinjaTrader Customer Service

                Comment


                  #53
                  Is it possible to add a gridsplitter to a custom side panel?

                  Comment


                    #54
                    Hello martyn73,

                    This may be possible.

                    The ChartTrader area has gridsplitter already, so you would need to ensure you are not conflicting with this.
                    Chelsea B.NinjaTrader Customer Service

                    Comment


                      #55
                      Hello Chelsea,

                      I am trying to create a custom button to submit orders to NinjaTrader, using your ChartTraderCustomButtonsExamples code as a base. I have added the following to enter an order when button1 is clicked:

                      Code:
                      protected void Button1Click(object sender, RoutedEventArgs e)
                              {
                                  order = EnterLongLimit(quantity, price, @"Long");  
                              }
                      However, I get a CS0103 error saying that "enterlonglimit does not exist in the current context". What should I add to my code so that the indicator understands how to send orders?

                      I have declared the following at the beginning of the code:

                      Code:
                      using NinjaTrader.Cbi;
                      using NinjaTrader.Gui;
                      using NinjaTrader.Gui.Chart;
                      using NinjaTrader.Gui.SuperDom;
                      using NinjaTrader.Gui.Tools;
                      using NinjaTrader.Data;
                      using NinjaTrader.NinjaScript;
                      using NinjaTrader.Core.FloatingPoint;
                      using NinjaTrader.NinjaScript.Indicators;
                      using NinjaTrader.NinjaScript.DrawingTools;
                      I have made no other changes to your code.

                      I did try to download the code here (https://ninjatraderecosystem.com/use...bar-buttons-2/) as you suggested, but for some reason the code does not download.

                      Thank you very much!
                      Guillaume

                      Comment


                        #56
                        Hello Guillaume,

                        May I confirm the script is a strategy and is not an indicator?

                        I have checked the link and I am finding the link is working and the Long Short Toolbar Buttons strategy can be downloaded on my end.

                        Are you getting an error when clicking the orange Download button?
                        Have you clicked the Accept checkbox?
                        Did you click the blue Download button?

                        Have you tried a different browser?
                        Chelsea B.NinjaTrader Customer Service

                        Comment


                          #57
                          Hello Chelsea,

                          Thank you very much for such a quick reply!

                          Yes, I left your code unchanged, so it was an indicator.

                          I could also download the LONGSHORT code, it was because of my browser that blocked pop-ups.

                          Thank you very much for your help!
                          Guillaume
                          Last edited by ggingembre; 05-06-2019, 11:49 PM.

                          Comment


                            #58
                            Hello Chelsea,

                            I have customized the long/short buttons tool bar, but there is one thing I cannot figure out: I would like to reset the buttons to original values after the entry of my atm strategy is executed (or it could be after any execution). I have tried with the following code, but it does not work.

                            protected override void OnExecutionUpdate(Execution execution, string executionId, double price, int quantity, MarketPosition marketPosition, string orderId, DateTime time)
                            Code:
                            {
                                    Dispatcher.InvokeAsync((() =>
                                                {
                                                    longButton.Content = "LONG";
                                                    longButton.Name = "LongButton";
                                                    longButtonClicked = false;
                            
                                                    shortButton.Content = "SHORT";
                                                    shortButton.Name = "ShortButton";
                                                    shortButtonClicked = false;
                                                }));
                            }
                            Do you have any suggestion on how to do this?
                            Thank you!
                            Guillaume

                            Comment


                              #59
                              Hello Guillaume,

                              You have mentioned:
                              "after the entry of my atm strategy is executed"

                              Are you using Atm Strategy methods or NinjaScript Strategy methods to place the order?

                              Have you added prints to ensure this code is being triggered?

                              Chelsea B.NinjaTrader Customer Service

                              Comment


                                #60
                                Hello Chelsea,

                                I have a problem with my (see attachment) and your (ChartToolBarCustomMenuExample) indicator. My indicator displays button on every tab/chart of the given window (even there is only one instance of the indicator in the window). Your indicator displays the button only on one of the tab (it is always the first tab where is the indicator implemented). The other tabs are without the button, even when I add there another instance of the indicator. My goal is to display the button (by my indicator) ONLY (but also ALWAYS) on the tab where is the indicator implemented.

                                Could you help me please?

                                Thank you,
                                emuns
                                Attached Files

                                Comment

                                Latest Posts

                                Collapse

                                Topics Statistics Last Post
                                Started by RT001, Today, 05:07 PM
                                1 response
                                12 views
                                0 likes
                                Last Post NinjaTrader_ChelseaB  
                                Started by Bobin, Today, 02:47 PM
                                1 response
                                27 views
                                0 likes
                                Last Post NinjaTrader_ChelseaB  
                                Started by Bobin, Today, 06:39 AM
                                2 responses
                                49 views
                                0 likes
                                Last Post jeronymite  
                                Started by ezrollin, Today, 01:29 PM
                                1 response
                                40 views
                                0 likes
                                Last Post NinjaTrader_ChelseaB  
                                Started by vpatanka, Today, 09:25 AM
                                1 response
                                56 views
                                0 likes
                                Last Post NinjaTrader_ChelseaB  
                                Working...
                                X