.NET-based studies

 

To build new study using .NET-based language you will need to have MS Visual Studio installed (or any other C# editor/compiler, for example SharpDevelop).

 

First, create new poject and add Easychart.Finance.dll (from Plugins folder) as a reference to the project.

 

Then create new class and derive it FormulaBase. Note class should be located in FML namespace.

 

Please, see the following sample to get better idea how new study should look like:

 

using Easychart.Finance;

using Easychart.Finance.DataProvider;

using System.Reflection;

using System.Runtime.CompilerServices;

 

namespace FML

{

        public class EMA:FormulaBase

        {

                  public double N=0;

                  public EMA():base()

                  {

                            AddParam("N","12","1","1000","",FormulaParamType.Double);

                  }

       

                  public override FormulaPackage Run(IDataProvider DP)

                  {

                      System.Collections.Generic.List<FormulaData> lFormulas = new                                                                                                                                                                           System.Collections.Generic.List<FormulaData>();

                            this.DataProvider = DP;

                            FormulaData NONAME0=EMA(C,N);lFormulas.Add(NONAME0);

                            return new FormulaPackage(lFormulas.ToArray(),"");

                  }

       

                  public override string LongName

                  {

                            get{return "EMA";}

                  }

       

                  public override string Description

                  {

                            get{return "";}

                  }

        } //class EMA

} // namespace FML

 


Copyright (c) WinTrend.Com 2010