NexusFi: Find Your Edge


Home Menu

 





NT8 : User drawn box on chart with mouse


Discussion in NinjaTrader

Updated
    1. trending_up 2,297 views
    2. thumb_up 3 thanks given
    3. group 0 followers
    1. forum 5 posts
    2. attach_file 0 attachments




 
Search this Thread
  #1 (permalink)
 
Popsicle's Avatar
 Popsicle 
Pretoria Gauteng
 
Experience: Intermediate
Platform: Sierra Charts
Trading: NQ
Posts: 250 since May 2016
Thanks Given: 2,448
Thanks Received: 553

Hi,

Does anyone maybe have any ideas, even general direction would be awesome, for allowing a user to draw a box with their mouse on a chart in NT8? I wrote code that will draw a box between two price bars if the user clicks on the first bar and then the second. I would like to adapt this code to do the following:

The user clicks somewhere on the chart and drags his mouse while holding in the left mouse button to draw a box around a set of price bars. When the user releases the left mouse button, that would be the user defined box.

My biggest problem at this point is the normal chart behavior that when a user left clicks on the chart and moves their mouse, the chart pans left and right. Not sure if this can be disabled in code for the period that the box is drawn.

I am developing this specifically for NT8. Any help or advice would be greatly appreciated.

Popsicle


Follow me on X Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Iran Ceasefire Surges to 19.5% on US 15-Point Plan -- 82 …
Prediction Markets & Event Contracts
Penalties in Budapest, Peace Deadline in Tehran: Arsenal …
Prediction Markets & Event Contracts
Trump Truth Social Fires Hormuz From 10% to 59% -- Arsen …
Prediction Markets & Event Contracts
Topstep Acquires The Futures Desk -- Prop Firm Consolida …
Funded Trading Evaluation Firms
Tradeify 3.0 Overhauls Futures Prop Firm Model -- One-Ti …
Funded Trading Evaluation Firms
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Sober Journey With S&P
24 thanks
2026 Jlab journal
10 thanks
Lady Vols Primer: Trading Volatility Journal
7 thanks
Algo automated / semi-automated trading anyone?
6 thanks
Trying to learn Volume and price action correlation
5 thanks
  #3 (permalink)
 
ratfink's Avatar
 ratfink 
Birmingham UK
Market Wizard
 
Experience: Intermediate
Platform: NinjaTrader
Broker: TST/Rithmic
Trading: YM/Gold
Posts: 3,550 since Dec 2012
Thanks Given: 17,423
Thanks Received: 8,430



Popsicle View Post
Hi,

Does anyone maybe have any ideas, even general direction would be awesome, for allowing a user to draw a box with their mouse on a chart in NT8? I wrote code that will draw a box between two price bars if the user clicks on the first bar and then the second. I would like to adapt this code to do the following:

The user clicks somewhere on the chart and drags his mouse while holding in the left mouse button to draw a box around a set of price bars. When the user releases the left mouse button, that would be the user defined box.

My biggest problem at this point is the normal chart behavior that when a user left clicks on the chart and moves their mouse, the chart pans left and right. Not sure if this can be disabled in code for the period that the box is drawn.

I am developing this specifically for NT8. Any help or advice would be greatly appreciated.

Popsicle

Surely it's one of the built-in drawing tools? It is in 7.


Travel Well
Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #4 (permalink)
 
Popsicle's Avatar
 Popsicle 
Pretoria Gauteng
 
Experience: Intermediate
Platform: Sierra Charts
Trading: NQ
Posts: 250 since May 2016
Thanks Given: 2,448
Thanks Received: 553

Thanks @ratfink. Unfortunately I need more control over the drawn box in terms of the bars it spans etc. I think you gave me an idea though, thank you very much. Will try it out.

Popsicle


Sent from my iPhone using NexusFi mobile app


Follow me on X Started this thread Reply With Quote
Thanked by:
  #5 (permalink)
 
ratfink's Avatar
 ratfink 
Birmingham UK
Market Wizard
 
Experience: Intermediate
Platform: NinjaTrader
Broker: TST/Rithmic
Trading: YM/Gold
Posts: 3,550 since Dec 2012
Thanks Given: 17,423
Thanks Received: 8,430


Popsicle View Post
Thanks @ratfink. Unfortunately I need more control over the drawn box in terms of the bars it spans etc. I think you gave me an idea though, thank you very much. Will try it out.

Popsicle

Ok, cool. Be good to have people involved in these areas. In NT7 there is a lot of stuff around to help with capturing low-level events and using direct graphics, so it will be good to see some NT8 equivalents as well.

Cheers


Travel Well
Visit my NexusFi Trade Journal Reply With Quote
  #6 (permalink)
 
Popsicle's Avatar
 Popsicle 
Pretoria Gauteng
 
Experience: Intermediate
Platform: Sierra Charts
Trading: NQ
Posts: 250 since May 2016
Thanks Given: 2,448
Thanks Received: 553

Thanks @ratfink for putting me on the right track. For those interested in doing something similar, it is now possible in NT8 to provide your own custom drawing tool. In NT7 this was quite a mission but they made it very easy in NT8.

I will be using the built in Rectangle drawing tool and writing a custom drawing tool to extend it with the functionality I need. The following Ninjatrader support forum post is an awesome place to start if this is something you want to do.

Custom Drawing Tool - NinjaTrader Support Forum


Follow me on X Started this thread Reply With Quote
Thanked by:




Last Updated on September 26, 2016


© 2026 NexusFi®, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Downloads - Top
no new posts