Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
Well I'm trying to get into ninja and to learn to override plot. I'm going to post stuff as I go. Hopefully it can help someone else to learn in the future and just incase my machine crashes or something I will have a back up.
All this should work if you create an empty indicator and stick in the plot function.
This first one was just to get a feel for painting/filling rectangles and strings to the screen with Chartcontrol stuff.
You should be able to comment out parts to make it more clear what is what if need be.
int Bottom = ChartControl.Bottom;
int Top = ChartControl.Top;
int MarginTop = ChartControl.MarginTop;
int BarMarginRight = ChartControl.BarMarginRight;
int CanvasRight = ChartControl.CanvasRight;
int CanvasLeft = ChartControl.CanvasLeft;
int CanvasTop = ChartControl.CanvasTop;
int CanvasBottom = ChartControl.CanvasBottom;
int BoundsHeight = bounds.Height;
int BoundsBottom = bounds.Bottom;
int First = ChartControl.FirstBarPainted;
Needs a little more color..This is using the alpha channel for transparency and making 4 boxes that scale to the chart size.
public override void Plot(Graphics graphics, Rectangle bounds, double min, double max)
{
int alpha = 70;
Color red = Color.FromArgb(255, 0, 0);
Color green = Color.FromArgb(0, 255, 0);
Color blue = Color.FromArgb(0, 0, 255);
Color notsure = Color.FromArgb(100, 0, 155);
SolidBrush AlphaBrush1 = new SolidBrush(Color.FromArgb(alpha,red));
SolidBrush AlphaBrush2 = new SolidBrush(Color.FromArgb(alpha,green));
SolidBrush AlphaBrush3 = new SolidBrush(Color.FromArgb(alpha,blue));
SolidBrush AlphaBrush4 = new SolidBrush(Color.FromArgb(alpha,notsure));
Yea I thought a heatmap might be a fun project to learn with. Made pretty good progress tonight. This code is sloppy as hell though.
Drawing boxes with a loop and changing color with a loop.
public override void Plot(Graphics graphics, Rectangle bounds, double min, double max)
{
Color red = Color.FromArgb(255, 0, 0);
Color green = Color.FromArgb(0, 255, 0);
Color blue = Color.FromArgb(0, 0, 255);
int x = bounds.X;
int y = bounds.Y;
int test = 0;
int alpha = 100;
int boxX;
int boxY;
int ycolorchange = 0;
SolidBrush myBrush = new SolidBrush(blue);
int CanvasRightEnd = ChartControl.CanvasRight;
int CanvasBottomEnd = ChartControl.CanvasBottom;
Here's an addition or two - you can see I'm also learning but I'm only scabbing things together. Not sure when I'll have a decent breakthrough. This is using the genericoverlay file from the NT support forum. This particular file is using MACD. I'm trying some other inputs as well (I've seen the stochastic and rsi overlays) but want to get up/down coloring to work first.
I haven't been able to get PlotColors[0][0] to work for Rising/Falling conditions. I've tried too many variations to post here. If someone can give a heads up or modify the attached code, I'd appreciate it greatly.