NexusFi: Find Your Edge


Home Menu

 





Drawing a fixed box in the chart


Discussion in NinjaTrader

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




 
Search this Thread
  #1 (permalink)
 jtorres 
Madrid - SPain
 
Experience: Beginner
Platform: Ninjatrader
Trading: CL Future
Posts: 11 since Sep 2013
Thanks Given: 2
Thanks Received: 0

I need draw a box with text fixed in a determine point of a chart wihtout relation with the price.
Somebody knows how could i code it?

The DrawRectangle function depends on price and move with it. :/

Thank you !


Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Coinbase Launches Regulated Crypto Futures Across 26 Eur …
Cryptocurrency
GDP Day: The First Economic Reckoning -- Pahlavi at 6.55 …
Prediction Markets & Event Contracts
CME Cuts Precious Metals Margins Up to 21% Starting Toda …
Commodities
Iran Peace Expired NO: Ceasefire on Life Support, OPEC a …
Prediction Markets & Event Contracts
The 50/50 Paradox: Peace and Invasion Each at 20% -- Ira …
Prediction Markets & Event Contracts
 
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)
 
rleplae's Avatar
 rleplae 
Gits (Hooglede) Belgium
Legendary Market Wizard
 
Experience: Master
Platform: NinjaTrader, Proprietary,
Broker: Ninjabrokerage/IQfeed + Synthetic datafeed
Trading: 6A, 6B, 6C, 6E, 6J, 6S, ES, NQ, YM, AEX, CL, NG, ZB, ZN, ZC, ZS, GC
Posts: 2,947 since Sep 2013
Thanks Given: 2,442
Thanks Received: 5,860


You would need to do something like this :

 
Code
.
	public override void Plot(Graphics graphics, Rectangle bounds, double min, double max)
        {
					Brush backBrush = new SolidBrush(Color.FromArgb(backgroundOpacity, backgroundColor));
					graphics.FillRectangle(backBrush, xOffset, yOffset, longestLine, totalHeight);
					backBrush.Dispose();
					Pen borderPen = new Pen(borderColor);
					graphics.DrawRectangle(borderPen, xOffset, yOffset, longestLine, totalHeight);
					borderPen.Dispose();
        }
It is not a working sample, you need to replace the colors and the coordinates
( extract taken from jtEconNews2.cs ), but should give you a clear idea how to do


Follow me on X Visit my NexusFi Trade Journal Reply With Quote




Last Updated on August 24, 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