NexusFi: Find Your Edge


Home Menu

 





Drawing a fixed box in the chart


Discussion in NinjaTrader

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




 
Search this Thread

Drawing a fixed box in the chart

  #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?
Trade idea based off three indicators.
Traders Hideout
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
About a successful futures trader who didnt know anythin …
Psychology and Money Management
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
REcommedations for programming help
Sierra Chart
 
  #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: 3,003 since Sep 2013
Thanks Given: 2,442
Thanks Received: 5,863


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 Twitter Visit my NexusFi Trade Journal Reply With Quote




Last Updated on August 24, 2016


© 2024 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 - Privacy Policy - Downloads - Top
no new posts