LogoLogo
Back to HaasOnline.comSwitch to Trade Platform
2.x
2.x
  • Welcome
  • Examples
    • Script Bots
      • ScriptBotAPI
      • ScriptBotContext
      • ScriptBotScriptBase
    • Script Indicators
      • IndicatorAPI
      • IndicatorContext
      • IndicatorScriptBase
  • Other Resources
    • YouTube
    • Guides & Tutorials
    • Questions & Answers
    • Community Projects
  • Need Help?
    • Ask on Discord
    • Ask on Telegram
    • Submit support ticket
Powered by GitBook
On this page

Was this helpful?

  1. Examples
  2. Script Indicators

IndicatorScriptBase

PreviousIndicatorContext

Last updated 6 years ago

Was this helpful?

IndicatorScriptBase is the default . This class can be inherited and used to create a custom Script Indicator by changing elements of the default script, without having to implement all members of the -interface.

 public class IndicatorScriptBase : IIndicatorScript
    {
        public virtual string Name
        {
            get
            {
                return "Default empty Indicator-script";
            }
        }

        public virtual IndicatorResult GetResult(IndicatorContext context)
        {
            return IndicatorResult.Stay;
        }

        public virtual void Init()
        {
            //Do nothing
        }

        public virtual int PriceHistoryLimit
        {
            get { return 50; }
        }


        public virtual List<DataSerie> ChartDataSeries
        {
            get { return new List<DataSerie>(); } //Return empty list => no charts
        }

        public virtual List<double> GetChartData(IndicatorContext context)
        {
            return new List<double>(); //Return empty list => no charts
        }

        public virtual List<ScriptParameter> GetParameters()
        {
            return new List<ScriptParameter>(); //Return empty list => no user parameters
        }

        public virtual void SetParameters(Dictionary<string, object> parameters)
        {
            //Do nothing
        }

    }
Script Indicator
IndicatorScript