NexusFi: Find Your Edge


Home Menu

 





MultiCharts.net EMA Color Slope


Discussion in MultiCharts

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




 
Search this Thread
  #1 (permalink)
caballer
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 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
Elite Membership required to download: EMA_Color_Slope.zip
Reply With Quote

Can you help answer these questions
from other members on NexusFi?
The 50/50 Paradox: Peace and Invasion Each at 20% -- Ira …
Prediction Markets & Event Contracts
Warsh Confirmed 54-45 on PPI Day -- 97% Say He Holds in …
Prediction Markets & Event Contracts
MyForexFunds Begins Returning Frozen Funds After CFTC Ca …
Funded Trading Evaluation Firms
Iran Ceasefire Surges to 19.5% on US 15-Point Plan -- 82 …
Prediction Markets & Event Contracts
Iran Talks Final Stages -- Two VLCCs Exit Hormuz, Record …
Traders Hideout
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Sober Journey With S&P
24 thanks
2026 Jlab journal
10 thanks
Algo automated / semi-automated trading anyone?
6 thanks
Lady Vols Primer: Trading Volatility Journal
6 thanks
2026 Fire Horse
5 thanks
  #2 (permalink)
 
FuManChou's Avatar
 FuManChou 
Saint Paul, Minnesota, United States
 
Experience: Intermediate
Platform: MultiCharts
Broker: Edge Clear LLC
Trading: MNQ
Frequency: Many times daily
Duration: Hours
Posts: 109 since Jun 2019
Thanks Given: 1,144
Thanks Received: 122

Thanks for posting!


Reply With Quote




Last Updated on April 20, 2021


© 2026 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 - Downloads - Top
no new posts