Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Modifications to chart WPF elements and tab considerations

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

  • NinjaTrader_ChelseaB
    replied
    Hello emuns,

    Please see lines 138 through 142, and lines 145 through 158 in the ChartToolBarCustomMenuExample.
    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

    Leave a comment:


  • emuns
    replied
    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

    Leave a comment:


  • NinjaTrader_ChelseaB
    replied
    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?

    Leave a comment:


  • ggingembre
    replied
    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

    Leave a comment:


  • ggingembre
    replied
    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-07-2019, 12:49 AM.

    Leave a comment:


  • NinjaTrader_ChelseaB
    replied
    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?

    Leave a comment:


  • ggingembre
    replied
    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

    Leave a comment:


  • NinjaTrader_ChelseaB
    replied
    Hello martyn73,

    This may be possible.

    The ChartTrader area has gridsplitter already, so you would need to ensure you are not conflicting with this.

    Leave a comment:


  • martyn73
    replied
    Is it possible to add a gridsplitter to a custom side panel?

    Leave a comment:


  • NinjaTrader_ChelseaB
    replied
    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.

    Leave a comment:


  • calebsandfort
    replied
    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.

    Leave a comment:


  • NinjaTrader_ChelseaB
    replied
    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.

    Leave a comment:


  • calebsandfort
    replied
    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

    Leave a comment:


  • NinjaTrader_ChelseaB
    replied
    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?


    Leave a comment:


  • calebsandfort
    replied
    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().




    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

    Leave a comment:

Latest Posts

Collapse

Topics Statistics Last Post
Started by cmoran13, 04-16-2026, 01:02 PM
0 responses
51 views
0 likes
Last Post cmoran13  
Started by PaulMohn, 04-10-2026, 11:11 AM
0 responses
31 views
0 likes
Last Post PaulMohn  
Started by CarlTrading, 03-31-2026, 09:41 PM
1 response
165 views
1 like
Last Post NinjaTrader_ChelseaB  
Started by CarlTrading, 04-01-2026, 02:41 AM
0 responses
100 views
1 like
Last Post CarlTrading  
Started by CaptainJack, 03-31-2026, 11:44 PM
0 responses
160 views
2 likes
Last Post CaptainJack  
Working...
X