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)
I have finished programing this double SMA indicator with arrows when Crossover.
the only thing left and i struggled to add to this simple indicator is to make the fast SMA changes it's color to LIME when it's Crossabove the slow moving average and a RED color when it's crossBelow the slow moving average. I will post my script and i would appreciate it if anyone could help in coding the color changing of the fast moving average to finish this indicator
=====
#region Variables
// Wizard generated variables
private int average = 14; // Default setting for Average
private int trigger = 11; // Default setting for Trigger
// User defined variables (add any user defined variables below)
private Color buyArrowColor = Color.Lime;
private Color sellArrowColor = Color.Red;
#endregion
/// <summary>
/// This method is used to configure the indicator and is called once before any bar data is loaded.
/// </summary>
protected override void Initialize()
{
Add(new Plot(new Pen(Color.Blue,2f), PlotStyle.Line, "Avg"));
Add(new Plot(new Pen(Color.White,2f), PlotStyle.Line,"Trigger"));
Plots[1].Pen.DashStyle = DashStyle.Dash;
Overlay = true;
}
/// <summary>
/// Called on each bar update event (incoming tick)
/// </summary>
protected override void OnBarUpdate()
{
// Use this method for calculating your indicator values. Assign a value to each
// plot below by replacing 'Close[0]' with your own formula.
Avg.Set(SMA(Average)[0]);
Trg.Set(SMA(Trigger)[0]);
//buy condition:
if (CrossAbove(SMA(Trigger),SMA(Average),1))
I will present a webinar on very basic Ninjascript coding and debugging. As you know NinjaScript is based on C#, but this will not be a webinar on C# programming itself, I will only show very basic C# stuff.
At the end of the webinar, a guy with no …
And/or @shodson's NT webinar which gives you the basic building blocks of C#:
I will be presenting a webinar on introductory principle of Ninjascript and the C# programming language upon which it is based.
Pre-requisites: It is assumed that you have some programming experience, and that you understand basic concepts of programming …
Or look at any one of the hundreds of indicators on nexusfi.com (formerly BMT) that have multicolor plots and look at the code and learn. This is the simplest.
even though the videos aren't working with me, but thanks a lot Mike
beside I know what i needed was simple, but that's simple for you brother, you're experienced and professional @ it, for a starter guy like it will sound a little bit hard but don't worry mate I'll find out a way to get it working somehow.
BTW, i downloaded some muliticolors indicator from the forum and tried to see the code but unfortunately couldn't apply it on mine ..
If you are not a programmer, then best to hire your work done by a professional to get you started if you aren't willing to read books and example code and learn the language.
Thanks for your advice gulabv, i've tried this code before and it compiles fine but, when i apply the indicator i cant see any moving average they just disappear !!!
CrossAbove) and CrossBelow() only define the bar, when the trigger crosses the average. To color you averages you do not want to use them, but use the simple conditions