MultiCharts.net EMA Color Slope - futures io
futures io



MultiCharts.net EMA Color Slope


Discussion in MultiCharts

Updated
    1. trending_up 412 views
    2. thumb_up 4 thanks given
    3. group 1 followers
    1. forum 0 posts
    2. attach_file 1 attachments




Welcome to futures io: the largest futures trading community on the planet, with well over 125,000 members
  • 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 and simple.

-- Big Mike, Site Administrator

(If you already have an account, login at the top of the page)

 
Search this Thread
 

MultiCharts.net EMA Color Slope

(login for full post details)
  #1 (permalink)
caballer
New York City, NY/USA
 
 
Posts: 3 since Jan 2013
Thanks: 0 given, 1 received

I couldn't find this indicator online anywhere for MultiCharts.net, so I modified the built-in EMA indicator on MulitCharts.net to change color based on the slope. Posting here in case anyone needs it.






using System;
using System.Drawing;
using PowerLanguage.Function;

namespace PowerLanguage.Indicator
{
[SameAsSymbol(true)]
public class Mov_Avg_Exponential_Color : IndicatorObject
{
private XAverage m_xaverage1;

private VariableSeries<Double> m_avgexp;

private IPlotObject Plot1;

public Mov_Avg_Exponential_Color(object ctx) :
base(ctx){
length = 9;
usecolorupdown = true;
colorup = Color.GreenYellow;
colordown = Color.Red;
}

private ISeries<double> price { get; set; }

[Input]
public int length { get; set; }

[Input]
public int displace { get; set; }

[Input]
public bool usecolorupdown { get; set; }

[Input]
public Color colorup { get; set; }

[Input]
public Color colordown { get; set; }

protected override void Create(){
m_xaverage1 = new XAverage(this);
m_avgexp = new VariableSeries<Double>(this);
Plot1 =
AddPlot(new PlotAttributes("AvgExp", 0, Color.GreenYellow,
Color.Empty, 0, 0, true));
}

protected override void StartCalc(){
price = Bars.Close;
m_xaverage1.Price = price;
m_xaverage1.Length = length;
}


protected override void CalcBar(){
m_avgexp.Value = m_xaverage1[0];
if (((displace >= 0)
|| Bars.CurrentBar > Math.Abs(displace)))
if (usecolorupdown)
{
if (PublicFunctions.DoubleGreater(m_avgexp.Value, m_avgexp[1]))
Plot1.Colors[0] = colorup;
else
Plot1.Colors[0] = colordown;
}{
Plot1.Set(displace, m_avgexp.Value);
if ((displace <= 0)){
if (((PublicFunctions.DoubleGreater(price[0], m_avgexp.Value) &&
PublicFunctions.DoubleGreater(m_avgexp.Value, m_avgexp[1]))
&& PublicFunctions.DoubleLessEquals(m_avgexp[1], m_avgexp[2]))){
Alerts.Alert("Indicator turning up");
}
else{
if (((PublicFunctions.DoubleLess(price[0], m_avgexp.Value) &&
PublicFunctions.DoubleLess(m_avgexp.Value, m_avgexp[1]))
&& PublicFunctions.DoubleGreaterEquals(m_avgexp[1], m_avgexp[2]))){
Alerts.Alert("Indicator turning down");
}
}
}
}
}
}
}

Attached Files
Register to download File Type: zip EMA_Color_Slope.zip (1.7 KB, 8 views)
Reply With Quote
The following 4 users say Thank You to caballer for this post:


futures io Trading Community Platforms and Indicators MultiCharts > MultiCharts.net EMA Color Slope


Last Updated on March 16, 2021


Upcoming Webinars and Events
 

NinjaTrader Indicator Challenge!

Ongoing
 

Journal Challenge w/$1,800 in prizes!

April
     



Copyright © 2021 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
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.
no new posts