 Millionaire in 10 weeks & Conversation with broker | Psychology and Money Management Millionaire in 10 weeks & Conversation with broker

Montreal

Posts: 128 since Jan 2013

 BTW Sierra chart support is the best!

Alright thanks, so Sierra Chart works on C++.

Do you know the difference between C++ and C Sharp (C#)?

For example here's the C# code for a 50 simple moving average...

Code
 using System; using System.Drawing; using PowerLanguage.Function; namespace PowerLanguage.Indicator { [SameAsSymbol(true)] public class Mov_Avg_1_Line : IndicatorObject { private AverageFC m_averagefc1; private VariableSeries m_avg; private IPlotObject Plot1; public Mov_Avg_1_Line(object ctx) : base(ctx){ length = 50; } private ISeries price { get; set; } [Input] public int length { get; set; } [Input] public int displace { get; set; } protected override void Create(){ m_averagefc1 = new AverageFC(this); m_avg = new VariableSeries(this); Plot1 = AddPlot(new PlotAttributes("Avg", 0, Color.Yellow, Color.Empty, 0, 0, true)); } protected override void StartCalc(){ price = Bars.Close; m_averagefc1.price = price; m_averagefc1.length = length; } protected override void CalcBar(){ m_avg.Value = m_averagefc1; if (displace >= 0 || Bars.CurrentBar > Math.Abs(displace)){ Plot1.Set(displace, m_avg.Value); if (displace <= 0){ if (this.CrossesOver(price, m_avg)){ Alerts.Alert("Price crossing over average"); } else{ if (this.CrossesUnder(price, m_avg)){ Alerts.Alert("Price crossing under average"); } } } } } } }
Can you please post the code of a C++ Sierra Chart of a simple Moving Average so that we can compare the code?

Also, do you know anything about EasyLanguage?

For example, this is the code for that same Simple Moving Average in EasyLanguage.

Code
 inputs: Price(Close),Length(50); variables: Avg(0); Avg = AverageFC(Price,Length); Plot1(Avg,"Avg",Default,blue);
If you can understand both codes up there, then I will send you my indicator code to convert them.

Thanks

Merlin

Last edited by MerlinWorld; July 28th, 2019 at 05:12 PM.