Go Back   NinjaTrader Support Forum > NinjaTrader 8 > Add-On Development

Add-On Development General NinjaScript development questions.

NinjaTrader
Reply
 
Thread Tools Display Modes
Old 04-06-2018, 04:55 AM   #1
ruppschtaler
Member
 
Join Date: Mar 2015
Location: Cape Town
Posts: 36
Thanks: 18
Thanked 0 times in 0 posts
Default Green OC at the top right of the chart

Hi there,

I need to show a green OC at the top right of the chart in my Add-On, indicating OCO is enabled - similar to NinjaTrader Chart.

Did I overlook a property of NTWindow to show or hide this control?
If not: I assume you have simply added a green TextBlock to NTWindow.MainMenu.
Here's the question how do you managed to allign it to the right side?

Thanks in advance!
ruppschtaler is offline  
Reply With Quote
Old 04-06-2018, 12:10 PM   #2
NinjaTrader_Jim
NinjaTrader Customer Service
 
NinjaTrader_Jim's Avatar
 
Join Date: Nov 2016
Location: Denver, CO
Posts: 1,828
Thanks: 98
Thanked 493 times in 468 posts
Default

Hello ruppschtaler,

Thanks for opening the thread.

I do not see a straight forward way of doing this, but I am investigating further to see how this can be accomplished.

Thanks in advance for your patience.
NinjaTrader_Jim is online now  
Reply With Quote
The following user says thank you to NinjaTrader_Jim for this post:
Old 04-06-2018, 03:01 PM   #3
NinjaTrader_Jim
NinjaTrader Customer Service
 
NinjaTrader_Jim's Avatar
 
Join Date: Nov 2016
Location: Denver, CO
Posts: 1,828
Thanks: 98
Thanked 493 times in 468 posts
Default

Thanks for your patience ruppschtaler,

After numerous tests involving DockPanel's, setting alignment, adding a grid with a column with a width of Star, and binding the width of the DockPanel to the window, I have not been successful in finding a way to align object to the right along an the main toolbar.

Although I could not set a control to be right aligned in the toolbar, it is possible to add a DockPanel with a specific width and then to have items within the DockPanel align to the right of the panel.

Code:
MyControl.HorizontalAlignment = HorizontalAlignment.Right;

DockPanel dockPanel = new DockPanel();
dockPanel.Width = 500;
dockPanel.HorizontalAlignment = HorizontalAlignment.Stretch;

dockPanel.Children.Add(MyControl);
DockPanel.SetDock(MyControl, Dock.Right);

MainMenu.Add(dockPanel);
Since the toolbar is governed by internal styles, I cannot provide a straight forward way to achieve the effect.

If there is anything else I can do to assist, please let me know.
NinjaTrader_Jim is online now  
Reply With Quote
The following user says thank you to NinjaTrader_Jim for this post:
Old 04-07-2018, 02:22 AM   #4
ruppschtaler
Member
 
Join Date: Mar 2015
Location: Cape Town
Posts: 36
Thanks: 18
Thanked 0 times in 0 posts
Default

Hi Jim,

Thank you so much for your help!
I've added to your code a dynamic resize of DockPanel's Width in the NTWindow.SizeChanged event handler - works acceptable.
Can you please open a feature request to expose the OC TextBlock visibility of NTWindow class?

Kind regards
ruppschtaler is offline  
Reply With Quote
Old 04-09-2018, 08:31 AM   #5
NinjaTrader_Jim
NinjaTrader Customer Service
 
NinjaTrader_Jim's Avatar
 
Join Date: Nov 2016
Location: Denver, CO
Posts: 1,828
Thanks: 98
Thanked 493 times in 468 posts
Default

Hello ruppschtaler,

I'm glad you found a solution with SizeChanged.

I've created a feature request with ticket ID SFT-3138.

As with other feature requests, we cannot present an ETA as they are fulfilled based on the development team's schedule and priorities. Upon implementation the ticket ID can be found publicly on the Release Notes page of the help guide. I'll provide a link below.

Release Notes: https://ninjatrader.com/support/help...ease_notes.htm

Thanks for your feedback!
NinjaTrader_Jim is online now  
Reply With Quote
The following user says thank you to NinjaTrader_Jim for this post:
Old 04-09-2018, 11:43 PM   #6
ruppschtaler
Member
 
Join Date: Mar 2015
Location: Cape Town
Posts: 36
Thanks: 18
Thanked 0 times in 0 posts
Default

Hello Jim,

Could you please add a second green TextBlock 'SO' for simulated orders to the feature request SFT-3138?

Thank you very much.
ruppschtaler is offline  
Reply With Quote
Old 04-10-2018, 07:15 AM   #7
NinjaTrader_Jim
NinjaTrader Customer Service
 
NinjaTrader_Jim's Avatar
 
Join Date: Nov 2016
Location: Denver, CO
Posts: 1,828
Thanks: 98
Thanked 493 times in 468 posts
Default

Hello ruppschtaler,

No problem. I've updated this feature request.
NinjaTrader_Jim is online now  
Reply With Quote
The following user says thank you to NinjaTrader_Jim for this post:
Old 05-17-2018, 12:31 PM   #8
oldporkchops
Junior Member
 
Join Date: Dec 2016
Posts: 15
Thanks: 3
Thanked 1 time in 1 post
Lightbulb What does Green OC at top right of chart mean?

What does Green OC at top right of chart mean? Also, could you please let me know why some of my charts have it, and why some do not? Thanks.
oldporkchops is offline  
Reply With Quote
Old 05-17-2018, 01:08 PM   #9
NinjaTrader_Jim
NinjaTrader Customer Service
 
NinjaTrader_Jim's Avatar
 
Join Date: Nov 2016
Location: Denver, CO
Posts: 1,828
Thanks: 98
Thanked 493 times in 468 posts
Default

Hello oldporkchops,

It represents OCO being enabled. Chart Trader must be enabled to allow order entry and turning OCO on/off for that chart.

Further reading on OCO on charts is publicly available here: https://ninjatrader.com/support/help...OtherocoOrders

Please let us know if you have any additional questions.
NinjaTrader_Jim is online now  
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
WalkForward - fwd-testing top 5 backtested sets instead of top 1? kc0793 Platform Technical Support 5 11-04-2014 04:51 PM
Sumbit orders as OC group binwang2 General Development 3 11-15-2013 01:58 PM
Chart always on top florida99 Platform Technical Support 1 08-06-2012 10:18 AM
Putting a constant tex at the middle of the top chart, whenever the chart moves MoreYummy Platform Technical Support 1 03-06-2010 06:14 PM


All times are GMT -6. The time now is 01:33 PM.

Futures, foreign currency and options trading contains substantial risk and is not for every investor. An investor could potentially lose all or more than the initial investment. Risk capital is money that can be lost without jeopardizing ones financial security or lifestyle. Only risk capital should be used for trading and only those with sufficient risk capital should consider trading. Past performance is not necessarily indicative of future results. View Full Risk Disclosure.

CFTC Rules 4.41 - Hypothetical or Simulated performance results have certain limitations, unlike an actual performance record, simulated results do not represent actual trading. Also, since the trades have not been executed, the results may have under-or-over compensated for the impact, if any, of certain market factors, such as lack of liquidity. Simulated trading programs in general are also subject to the fact that they are designed with the benefit of hindsight. No representation is being made that any account will or is likely to achieve profit or losses similar to those shown.

This website is hosted and operated by NinjaTrader, LLC (“NT”), a software development company which owns and supports all proprietary technology relating to and including the NinjaTrader trading platform. NT is an affiliated company to NinjaTrader Brokerage (“NTB”), which is a NFA registered introducing broker (NFA #0339976) providing brokerage services to traders of futures and foreign exchange products. This website is intended for educational and informational purposes only and should not be viewed as a solicitation or recommendation of any product, service or trading strategy. No offer or solicitation to buy or sell securities, securities derivative or futures products of any kind, or any type of trading or investment advice, recommendation or strategy, is made, given, or in any manner endorsed by any NT affiliate and the information made available on this Web site is not an offer or solicitation of any kind. Specific questions related to a brokerage account should be sent to your broker directly. The content and opinions expressed on this website are those of the authors and do not necessarily reflect the official policy or position of NT or any of its affiliates. 

Vendors along with their websites, products and services, collectively referred to as (“Vendor Content”), are independent persons or companies that are in no manner affiliated with NT or any if its affiliates. NT or any of its affiliates are not responsible for, do not approve, recommend or endorse any Vendor Content referenced on this website and it’s your sole responsibility to evaluate Vendor Content. Please be aware that any performance information provided by a vendor should be considered hypothetical and must contain the disclosures required by NFA Rule 2-29(c). If you are interested in learning more about, or investigating the quality of, any such Vendor Content you must contact the vendor, provider or seller of such Vendor Content. No person employed by, or associated with, NT or any of its affiliates is authorized to provide any information about any such Vendor Content.