EMA Color Slope - futures io
futures io EMA Color Slope

Discussion in MultiCharts

    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 EMA Color Slope

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

I couldn't find this indicator online anywhere for, so I modified the built-in EMA indicator on 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
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) :
length = 9;
usecolorupdown = true;
colorup = Color.GreenYellow;
colordown = Color.Red;

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

public int length { get; set; }

public int displace { get; set; }

public bool usecolorupdown { get; set; }

public Color colorup { get; set; }

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;
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");
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 (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 > EMA Color Slope

Last Updated on March 16, 2021

Upcoming Webinars and Events

NinjaTrader Indicator Challenge!


Journal Challenge w/$1,800 in prizes!


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