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)
Explanation somewhere on creating custom plots with colors etc......
The variables created in main function declared globally are available to that function.
Also, if you have this in a separate study as I do, .... you can first capture into the main body of script any variables from OTHER studies, and then those variables are available to the void plot() function.
Woot!
Can you help answer these questions from other members on NexusFi?
The variables created in main function declared globally are available to that function.
Also, if you have this in a separate study as I do, .... you can first capture into the main body of script any variables from OTHER studies, and then those variables are available to the void plot() function.
Woot!
glad...ur getting interest.
about aligning text in graphics in different lines...there are string formats and you can get the hieght of text to be displayed to offset next line.
yes can have globals to transport values...but recently i stuck with graphics plot.....could not retain values
outside the Plot scope as opposite to other methods. It was very frustrating excercise to get values derived
inside graphics plot to outside. Hope some more experienced coder help me out.
public override void Plot(Graphics graphics,Rectangle bounds,double min,double max)
{
mymin = min; // mymin Global variable.
Print(mymin.ToString()); // works only if remains as long as in Plot. Losses value
} // outside the plot.
If you wanted to add the textbrush as a user input so that you could change the colors, how do you go about doing that?
this is simple and similar to other variables. Look following changes should be made in script.
1) Declare your text brush without initialisation and add another variable for color.
#region Variables
.........................
private System.Drawing.Brush textbrush; // no initialization of Brush
private Color textcolor; // variable for color.
..........................
#endregion
2) Initialize TextBrush where u need and dispose after use.
public override void Plot(Graphics graphics, Rectangle bounds, double min, double max)
{
............................
textbrush = new SolidBrush(textcolor); // initialize here
.......................
.......................
.......................
textbrush.Dispose(); // dispose after use.
}
3) Make provision for this in Properties...so that it could be shown for input.( Important)
#region Properties
[Description("Select Text Color")]
[Category("Colors")]
[Gui.Design.DisplayName("Text Color")]
public Color Textcolor
{
get { return textcolor; }
set { textcolor = value; }
}
#endregion