NexusFi: Find Your Edge


Home Menu

 





Override Plot - how to do FillRectangle in different panel


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one sbgtrading with 4 posts (1 thanks)
    2. looks_two Tasker_182 with 3 posts (0 thanks)
    3. looks_3 cory with 2 posts (0 thanks)
    4. looks_4 bobwest with 2 posts (0 thanks)
    1. trending_up 4,207 views
    2. thumb_up 1 thanks given
    3. group 3 followers
    1. forum 11 posts
    2. attach_file 3 attachments




 
Search this Thread

Override Plot - how to do FillRectangle in different panel

  #1 (permalink)
 sbgtrading 
Chicago
 
Experience: Advanced
Platform: NinjaTrader, MT4, TS
Posts: 17 since Mar 2010
Thanks Given: 3
Thanks Received: 9

Looking for how to have a subpanel indicator (with a custom Plot method) perform a graphics.FillRectangle() in the price panel.

Any suggestions?

Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Are there any eval firms that allow you to sink to your …
Traders Hideout
Futures True Range Report
The Elite Circle
My NT8 Volume Profile Split by Asian/Euro/Open
NinjaTrader
New Micros: Ultra 10-Year & Ultra T-Bond -- Live Now
Treasury Notes and Bonds
Exit Strategy
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Get funded firms 2023/2024 - Any recommendations or word …
65 thanks
Funded Trader platforms
42 thanks
Battlestations: Show us your trading desks!
25 thanks
NexusFi site changelog and issues/problem reporting
23 thanks
The Program
19 thanks

  #3 (permalink)
 
Tasker_182's Avatar
 Tasker_182 
Cedar Rapids, iowa
Legendary Market Wizard
 
Experience: Intermediate
Platform: Ninjatrader
Broker: Ninjatrader - Continuum
Posts: 716 since Aug 2009
Thanks Given: 476
Thanks Received: 1,401



sbgtrading View Post
Looking for how to have a subpanel indicator (with a custom Plot method) perform a graphics.FillRectangle() in the price panel.

Any suggestions?

Try adding this system bool: DrawOnPricePanel = true; //Just before you need to plot on price panel.

then change to false after plotting on price panel in order to resume plotting in your sub panel.

Hope this helps.

Be yourself; everyone else is already taken. Oscar Wilde
Reply With Quote
  #4 (permalink)
 
cory's Avatar
 cory 
virginia
 
Experience: Intermediate
Platform: ninja
Trading: NQ
Posts: 6,098 since Jun 2009
Thanks Given: 877
Thanks Received: 8,090


sbgtrading View Post
Looking for how to have a subpanel indicator (with a custom Plot method) perform a graphics.FillRectangle() in the price panel.

Any suggestions?

check out this indi

Reply With Quote
  #5 (permalink)
 sbgtrading 
Chicago
 
Experience: Advanced
Platform: NinjaTrader, MT4, TS
Posts: 17 since Mar 2010
Thanks Given: 3
Thanks Received: 9

Thanks for the responses...unfortunately they are not addressing a subtle part of the problem.

Here's a video showing this situation: PlotOverrideRectangleInPricePanel - SBGtrading's library

I'm using the graphics context here, not using Ninja's Draw methods. So setting "DrawOnPricePanel" to true doesn't work when using a graphics.FillRectangle call.

The sample indicator used in the video is attached to this message...if you want something to experiment on.


Again, thanks for your responses...looking for more input from you.

Attached Files
Elite Membership required to download: TestPlotOverride.cs
Started this thread Reply With Quote
  #6 (permalink)
 
Tasker_182's Avatar
 Tasker_182 
Cedar Rapids, iowa
Legendary Market Wizard
 
Experience: Intermediate
Platform: Ninjatrader
Broker: Ninjatrader - Continuum
Posts: 716 since Aug 2009
Thanks Given: 476
Thanks Received: 1,401

Sorry, I can't help further as it is beyond my level of knowledge.

Be yourself; everyone else is already taken. Oscar Wilde
Reply With Quote
  #7 (permalink)
 
bobwest's Avatar
 bobwest 
Western Florida
Site Moderator
 
Experience: Advanced
Platform: Sierra Chart
Trading: ES, YM
Frequency: Several times daily
Duration: Minutes
Posts: 8,162 since Jan 2013
Thanks Given: 57,335
Thanks Received: 26,267

Here's a crude method that I think will work, although it is not very elegant.

Let's say your indicator is meant to draw the rectangle on the price panel when condition x exists -- maybe you have a plot in the lower panel, and when x is true, it should draw the rectangle on the price panel.

I've gotten around this kind of problem in the past by writing two indicators. They both perform the same calculation and both know when condition x is true; one of them runs in the lower panel and plots whatever you want to plot there; the second does not do any plotting on the lower panel, but does draw the rectangle (or whatever else you want to see) on the price panel.

So you're doing the same amount of processing work twice, and it's pretty crude, and you've basically just duplicated the same code, but I think it will get you what you want in terms of the final result.

It's also pretty easy and you won't tear your hair out. Hope this works for you.

Bob.

When one door closes, another opens.
-- Cervantes, Don Quixote
Reply With Quote
  #8 (permalink)
 sbgtrading 
Chicago
 
Experience: Advanced
Platform: NinjaTrader, MT4, TS
Posts: 17 since Mar 2010
Thanks Given: 3
Thanks Received: 9


bobwest View Post
I've gotten around this kind of problem in the past by writing two indicators. They both perform the same calculation and both know when condition x is true; one of them runs in the lower panel and plots whatever you want to plot there; the second does not do any plotting on the lower panel, but does draw the rectangle (or whatever else you want to see) on the price panel.

So you're doing the same amount of processing work twice, and it's pretty crude, and you've basically just duplicated the same code, but I think it will get you what you want in terms of the final result.

Thanks for the input, Bob. I've done the same "2-inidicator approach" in the past. I'm just trying to find the "right" way to get around this issue. Afterall, NinjaTrader does it inherently int their Draw methods, so there's got to be a way.

I believe the issue is how to grab the graphics context of the price panel...because it's a different context than the subpanels. One way to do that is to have a price indicator place the Graphics context in a static class, but then again, we're not getting around the 2-indicator coordinated system.

Started this thread Reply With Quote
Thanked by:
  #9 (permalink)
 
bobwest's Avatar
 bobwest 
Western Florida
Site Moderator
 
Experience: Advanced
Platform: Sierra Chart
Trading: ES, YM
Frequency: Several times daily
Duration: Minutes
Posts: 8,162 since Jan 2013
Thanks Given: 57,335
Thanks Received: 26,267

Yeah, it seems that there has to be a way. NT doesn't provide much documentation, unfortunately, and this is the kind of thing they don't support.... Maybe in NT8.

When one door closes, another opens.
-- Cervantes, Don Quixote
Reply With Quote
  #10 (permalink)
 
cory's Avatar
 cory 
virginia
 
Experience: Intermediate
Platform: ninja
Trading: NQ
Posts: 6,098 since Jun 2009
Thanks Given: 877
Thanks Received: 8,090


you may have to translate your coordinates back to DrawRectangle parms.

Attached Files
Elite Membership required to download: TestPlotOverride.cs
Reply With Quote




Last Updated on December 16, 2013


© 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