Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using NinjaTrader.Data;
- using System;
- using System.ComponentModel;
- using System.Xml.Serialization;
- namespace NinjaTrader.NinjaScript.Indicators.VolumeRatiosTradePack.backend_files___dont_use
- {
- public class z_mainstream5 : Indicator
- {
- private Series<double> bBS;
- private Series<double> bLinReg;
- private Series<double> diverMapVal;
- [Browsable(false)]
- [XmlIgnore]
- public Series<double> DiverMapVal
- {
- get { base.Update(); return this.diverMapVal; }
- }
- protected override void OnStateChange()
- {
- if (State == State.SetDefaults)
- {
- base.Calculate = Calculate.OnBarClose;
- base.IsOverlay = (false);
- base.DrawOnPricePanel = (false);
- }
- else if (State == State.Configure)
- {
- //base.set_PriceTypeSupported(true);
- this.bBS = new Series<double>(this);
- this.bLinReg = new Series<double>(this);
- this.diverMapVal = new Series<double>(this);
- }
- }
- protected override void OnBarUpdate()
- {
- if (base.CurrentBar < 18) return;
- double item = base.Close[0] - ((base.MAX(base.High, 18)[0] + base.MIN(base.Low, 18)[0]) / 2 + base.EMA(base.Close, 18)[0]) / 2;
- this.bBS[0]=(item);
- double num = base.LinReg(this.bBS, 18)[0];
- this.bLinReg[0]=(num);
- this.diverMapVal[0]=(num);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement