MultiCharts - Donchian Channel
futures io


Categories Help    

MultiCharts
MultiCharts Downloads / MultiCharts Indicators

Share MultiCharts indicators, EasyLanguage indicators.


Entries
Donchian Channel
MultiCharts .NET64 Version 12.0 Release (Build 18187)

 
Code
using System;
using System.Drawing;
using System.Linq;
using PowerLanguage.Function;

namespace PowerLanguage.Indicator
{
	public class Donchian Channel : IndicatorObject
	{
		public Donchian Channel(object _ctx):base(_ctx)
		{
			n_bars = 5;
		}

        [Input]
        public int n_bars { get; set; }
		
		private IPlotObject plothigh, plotlow;
		
		protected override void Create()
		{
			plothigh = AddPlot(new PlotAttributes("plothigh", EPlotShapes.Line, Color.Red));
			plotlow = AddPlot(new PlotAttributes("plotlow", EPlotShapes.Line, Color.Red));
		}
		
		protected override void StartCalc()
		{
		}
		
		protected override void CalcBar()
		{
			if(Bars.High[5] > 0 && Bars.Low[5] > 0)
			{
				plothigh.Set(Bars.High.Highest(n_bars));
				plotlow.Set(Bars.Low.Lowest(n_bars));
			}
		}
	}
}


Category MultiCharts 
 
Suggest other entries I might like
Details: Donchian Channel
Category: MultiCharts 


October 7th, 2019
Size: 1.73 KB
Downloaded: 103 times
 

 
Category
 



Copyright © 2021 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada), info@futures.io
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.