NexusFi: Find Your Edge


Home Menu

 



Categories Help    

MultiCharts
MultiCharts Downloads / MultiCharts Indicators

Share MultiCharts indicators, EasyLanguage indicators.


Entries
Donchian Channel 5 *
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: 136 times
 


 
Category
 




© 2024 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 - Privacy Policy - Downloads - Top