NexusFi: Find Your Edge

Home Menu EMA Color Slope

Discussion in MultiCharts

    1. trending_up 2,541 views
    2. thumb_up 6 thanks given
    3. group 1 followers
    1. forum 1 posts
    2. attach_file 1 attachments

Search this Thread EMA Color Slope

  #1 (permalink)
New York City, NY/USA
Posts: 3 since Jan 2013
Thanks Given: 0
Thanks Received: 1

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
Elite Membership required to download:
Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Trade idea based off three indicators.
Traders Hideout
Platforms and Indicators
NT7 Indicator Script Troubleshooting - Camarilla Pivots
Any futures traders in Texas looking to give back to tho …
Traders Hideout
Who is behind ninza renko?
Traders Hideout
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Diary of a simple price action trader
20 thanks
Just another trading journal: PA, Wyckoff & Trends
16 thanks
My NQ Trading Journal
16 thanks
Coding money management strategies.
14 thanks
HumbleTraders next chapter
9 thanks
  #2 (permalink)
FuManChou's Avatar
Saint Paul, Minnesota, United States
Experience: Beginner
Platform: MultiCharts
Broker: Edge Clear LLC
Trading: MNQ
Posts: 100 since Jun 2019
Thanks Given: 1,127
Thanks Received: 120

Thanks for posting!

Reply With Quote

Last Updated on April 20, 2021

© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
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.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts