NexusFi: Find Your Edge


Home Menu

 





How to program indicator to change background color?


Discussion in MultiCharts

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




 
Search this Thread

How to program indicator to change background color?

  #1 (permalink)
 gztanwei 
toronto
 
Experience: Beginner
Platform: NinjaTrader
Posts: 33 since Sep 2009
Thanks Given: 3
Thanks Received: 11

Hi guys,

I am trying to program an indicator to change background color when some conditions are met.

I thought this is done straight forward with PlotAttributes constructor, but I can't see the change of background color at all. Could you help?

 
Code
Plot1 = AddPlot(new PlotAttributes("", EPlotShapes.LeftTick, Color.Blue,Color.LightBlue,1,EPlotStyle.Solid,false));

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
How to apply profiles
Traders Hideout
ZombieSqueeze
Platforms and Indicators
REcommedations for programming help
Sierra Chart
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Just another trading journal: PA, Wyckoff & Trends
31 thanks
Spoo-nalysis ES e-mini futures S&P 500
28 thanks
Tao te Trade: way of the WLD
24 thanks
Bigger Wins or Fewer Losses?
20 thanks
GFIs1 1 DAX trade per day journal
17 thanks
  #2 (permalink)
 
Jura's Avatar
 Jura   is a Vendor
 
Posts: 775 since Apr 2010
Thanks Given: 2,352
Thanks Received: 690


gztanwei View Post
I am trying to program an indicator to change background color when some conditions are met.

I thought this is done straight forward with PlotAttributes constructor, but I can't see the change of background color at all. Could you help?

Background colour changes set by `PlotAttributes()` only affect the background of cells in the Scanner/Watchlist window. For indicators added to charts this value is discarded.

There's a tutorial on `PlotAttributes` here: Setting plot options programmatically in [AUTOLINK]MultiCharts[/AUTOLINK] .NET: a closer look at PlotAttributes | TradingCode.net

Reply With Quote
Thanked by:
  #3 (permalink)
 gztanwei 
toronto
 
Experience: Beginner
Platform: NinjaTrader
Posts: 33 since Sep 2009
Thanks Given: 3
Thanks Received: 11



Jura View Post
Background colour changes set by `PlotAttributes()` only affect the background of cells in the Scanner/Watchlist window. For indicators added to charts this value is discarded.

There's a tutorial on `PlotAttributes` here: Setting plot options programmatically in [AUTOLINK]MultiCharts[/AUTOLINK] .NET: a closer look at PlotAttributes | TradingCode.net

Thanks. So is changing background color of the chart possible in MC?

Like in below chart in NT, I used different color to represent different "state" of the market.

Started this thread Reply With Quote
  #4 (permalink)
 
Jura's Avatar
 Jura   is a Vendor
 
Posts: 775 since Apr 2010
Thanks Given: 2,352
Thanks Received: 690


gztanwei View Post
Thanks. So is changing background color of the chart possible in MC?

Like in below chart in NT, I used different color to represent different "state" of the market.

That's not possible no, and certainly not possible like it is in NT.

You could do a workaround where you draw a bunch of plots, all with the same colour, to make it look like there's another background colour. But that's a lot of coding work and will very likely negatively impact the performance of your script. So a hack, nothing more.

Reply With Quote
  #5 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,433 since Apr 2013
Thanks Given: 481
Thanks Received: 1,627

Yes, you can do that nicely in MC.NET, too. You will have to use GDI for that, though.

Regards,
ABCTG


gztanwei View Post
Thanks. So is changing background color of the chart possible in MC?

Like in below chart in NT, I used different color to represent different "state" of the market.


Follow me on Twitter Reply With Quote
  #6 (permalink)
 
Jura's Avatar
 Jura   is a Vendor
 
Posts: 775 since Apr 2010
Thanks Given: 2,352
Thanks Received: 690


ABCTG View Post
Yes, you can do that nicely in MC.NET, too. You will have to use GDI for that, though.

Never looked into that yet. Do you have a code example/snippet for that?

Reply With Quote
  #7 (permalink)
 gztanwei 
toronto
 
Experience: Beginner
Platform: NinjaTrader
Posts: 33 since Sep 2009
Thanks Given: 3
Thanks Received: 11


Jura View Post
Never looked into that yet. Do you have a code example/snippet for that?

For NinjaTrader? For NT, it is the "BackColorAllSeries"

Example:
 
Code
			if(_CBBP_Signal_up>=1)	BackColorAllSeries[0]=Color.LightGoldenrodYellow;
			if(_CBBP_Signal_down>=1)	BackColorAllSeries[0]=Color.LightBlue;

Started this thread Reply With Quote
  #8 (permalink)
 gztanwei 
toronto
 
Experience: Beginner
Platform: NinjaTrader
Posts: 33 since Sep 2009
Thanks Given: 3
Thanks Received: 11


ABCTG View Post
Yes, you can do that nicely in MC.NET, too. You will have to use GDI for that, though.

Regards,
ABCTG

Thanks for the reply. Could you share more tips/samples on how to do it? I read this page but didn't get how to do it still.

4.7.1 Chart Custom Draw - MultiCharts

Started this thread Reply With Quote




Last Updated on August 26, 2015


© 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