NexusFi: Find Your Edge


Home Menu

 





Little help with Draw Region


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one Fat Tails with 5 posts (6 thanks)
    2. looks_two aligator with 3 posts (0 thanks)
    3. looks_3 monpere with 3 posts (1 thanks)
    4. looks_4 jram77 with 2 posts (1 thanks)
      Best Posters
    1. looks_one Fat Tails with 1.2 thanks per post
    2. looks_two cory with 1 thanks per post
    3. looks_3 jram77 with 0.5 thanks per post
    4. looks_4 monpere with 0.3 thanks per post
    1. trending_up 11,319 views
    2. thumb_up 9 thanks given
    3. group 6 followers
    1. forum 14 posts
    2. attach_file 1 attachments




 
Search this Thread
  #1 (permalink)
 
jram77's Avatar
 jram77 
union city nj
 
Experience: Intermediate
Platform: ninjatrader
Broker: Mirus futures/zen-fire
Trading: es
Posts: 6 since Apr 2010
Thanks Given: 16
Thanks Received: 2

First off I would like to thank all the intelligent generous people on this site. Secondly, let me apologize, I know this sections is reserved for programmers and I probably the furthest thing from one. So please keep that in mind in your responses. On my charts I have the ColorZone3 Indicator and I have right margin of 100. So the indicator only plots to the current bar and I would like it to plot all the way to the end of the chart. I did some research and I think this is the line in the code that I need to modify,
"DrawRegion("Zone1", CurrentBar, 0, myDataSeries1, myDataSeries2, zone1ClrBdr, zone1Clr, opacity );"
I've tried replacing the term "CurrentBar" with some ridiculous laymen terms that I thought might work, to no avail. Any help would be appreciated.

I've attached a screenshot of what I mean.
Cheers.


Attached Thumbnails
Click image for larger version

Name:	ES 03-11 (5 Min)  1_14_2011image.jpg
Views:	419
Size:	145.4 KB
ID:	28667  
Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Daytrading to swingtrading
Traders Hideout
Warsh Drops Easing Bias, December Hike Now Above 50% -- …
Prediction Markets & Event Contracts
Without Pulisic, USA 61.5% Live vs. Australia -- France …
Prediction Markets & Event Contracts
Ninjatrader users - good CONNECTIONs post and article fr …
NinjaTrader
Thanks Mike. Godspeed.
The Elite Circle
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Want your NinjaTrader indicator created, free?
5 thanks
Afternoon-close session
1 thanks
Franks Trading Journey
1 thanks
Denied 20K payouts: Alpha Futures
1 thanks
FootPrintV2 Chart for NT8
1 thanks
  #3 (permalink)
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Legendary Market Wizard
 
Experience: Advanced
Platform: NinjaTrader
Broker: Interactive Brokers
Trading: Futures & Stocks
Posts: 9,887 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,117



jram77 View Post
First off I would like to thank all the intelligent generous people on this site. Secondly, let me apologize, I know this sections is reserved for programmers and I probably the furthest thing from one. So please keep that in mind in your responses. On my charts I have the ColorZone3 Indicator and I have right margin of 100. So the indicator only plots to the current bar and I would like it to plot all the way to the end of the chart. I did some research and I think this is the line in the code that I need to modify,
"DrawRegion("Zone1", CurrentBar, 0, myDataSeries1, myDataSeries2, zone1ClrBdr, zone1Clr, opacity );"
I've tried replacing the term "CurrentBar" with some ridiculous laymen terms that I thought might work, to no avail. Any help would be appreciated.

I've attached a screenshot of what I mean.
Cheers.

This will be difficult to achieve with DrawRegion(). However, as you want to draw a rectangle, you might try DrawRectangle(). It uses variables of type double , so something like

 
Code
"DrawRectangle("Zone1", true, -10, myDataSeries1[0], CurrentBar, myDataSeries2[0], zone1ClrBdr, zone1Clr, opacity );"
should do the trick. The negative value - in bold - should extend your rectangle to the right border of the chart.


Reply With Quote
Thanked by:
  #4 (permalink)
 
jram77's Avatar
 jram77 
union city nj
 
Experience: Intermediate
Platform: ninjatrader
Broker: Mirus futures/zen-fire
Trading: es
Posts: 6 since Apr 2010
Thanks Given: 16
Thanks Received: 2

Worked great, Thanks FT. Gotta love copy + paste.


Started this thread Reply With Quote
Thanked by:
  #5 (permalink)
 
monpere's Avatar
 monpere 
Bala, PA, USA
 
Experience: Intermediate
Platform: NinjaTrader
Broker: Mirus, IB
Trading: SPY, Oil, Euro
Posts: 1,854 since Jul 2010
Thanks Given: 300
Thanks Received: 3,375


Fat Tails View Post
This will be difficult to achieve with DrawRegion(). However, as you want to draw a rectangle, you might try DrawRectangle(). It uses variables of type double , so something like

 
Code
"DrawRectangle("Zone1", true, -10, myDataSeries1[0], CurrentBar, myDataSeries2[0], zone1ClrBdr, zone1Clr, opacity );"
should do the trick. The negative value - in bold - should extend your rectangle to the right border of the chart.

You can do that now? I thought at one point that use to crash NT.


Reply With Quote
Thanked by:
  #6 (permalink)
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Legendary Market Wizard
 
Experience: Advanced
Platform: NinjaTrader
Broker: Interactive Brokers
Trading: Futures & Stocks
Posts: 9,887 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,117


monpere View Post
You can do that now? I thought at one point that use to crash NT.

Not aware of that problem, can you link to it?


Reply With Quote
  #7 (permalink)
 
monpere's Avatar
 monpere 
Bala, PA, USA
 
Experience: Intermediate
Platform: NinjaTrader
Broker: Mirus, IB
Trading: SPY, Oil, Euro
Posts: 1,854 since Jul 2010
Thanks Given: 300
Thanks Received: 3,375


Fat Tails View Post
Not aware of that problem, can you link to it?

I think that was early version of version 6. I had not tried it since. I remember trying that and crashing it.

NinjaTrader Support Forum - View Single Post - Draw to the right of the current bar on a chart


Reply With Quote
  #8 (permalink)
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Legendary Market Wizard
 
Experience: Advanced
Platform: NinjaTrader
Broker: Interactive Brokers
Trading: Futures & Stocks
Posts: 9,887 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,117


monpere View Post
I think that was early version of version 6. I had not tried it since. I remember trying that and crashing it.

NinjaTrader Support Forum - View Single Post - Draw to the right of the current bar on a chart

That was a long time ago. actually, I do not know whether is works, but so far have had no problems. Just did it.


Reply With Quote
  #9 (permalink)
 
monpere's Avatar
 monpere 
Bala, PA, USA
 
Experience: Intermediate
Platform: NinjaTrader
Broker: Mirus, IB
Trading: SPY, Oil, Euro
Posts: 1,854 since Jul 2010
Thanks Given: 300
Thanks Received: 3,375


Fat Tails View Post
That was a long time ago. actually, I do not know whether is works, but so far have had no problems. Just did it.

That's good to know. Man! I had to jump thru so many hoops a couple of years ago just to do something simple like that, and I made sure to give Ray at NT a good piece of my mind about it I guess that is progress. Now, I have to go back and change all my code


Reply With Quote
  #10 (permalink)
 
aligator's Avatar
 aligator 
Las Vegas, NV
Legendary Market Wizard
 
Experience: Advanced
Platform: Abacus, Slide Rule, HP-65
Trading: Futures, Stocks, Options
Posts: 3,780 since Aug 2010
Thanks Given: 1,105
Thanks Received: 6,186


@Fat Tails,

Can one use the Drawregion to fill between say the 30 and 70 lines on RSI indicator in indicator panel?

I tried it, but it painted inside the entire main series panel.

Thanks.


Visit my NexusFi Trade Journal Reply With Quote




Last Updated on September 25, 2013


© 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