retesere20

Untitled

Mar 22nd, 2018
103
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using NinjaTrader.Data;
  2. using System;
  3. using System.ComponentModel;
  4. using System.Xml.Serialization;
  5.  
  6. namespace NinjaTrader.NinjaScript.Indicators.VolumeRatiosTradePack.backend_files___dont_use
  7. {
  8. public class z_mainstream5 : Indicator
  9. {
  10. private Series<double> bBS;
  11. private Series<double> bLinReg;
  12. private Series<double> diverMapVal;
  13.  
  14. [Browsable(false)]
  15. [XmlIgnore]
  16. public Series<double> DiverMapVal
  17. {
  18. get { base.Update(); return this.diverMapVal; }
  19. }
  20.  
  21. protected override void OnStateChange()
  22. {
  23. if (State == State.SetDefaults)
  24. {
  25. base.Calculate = Calculate.OnBarClose;
  26. base.IsOverlay = (false);
  27. base.DrawOnPricePanel = (false);
  28. }
  29. else if (State == State.Configure)
  30. {
  31. //base.set_PriceTypeSupported(true);
  32. this.bBS = new Series<double>(this);
  33. this.bLinReg = new Series<double>(this);
  34. this.diverMapVal = new Series<double>(this);
  35. }
  36. }
  37.  
  38. protected override void OnBarUpdate()
  39. {
  40. if (base.CurrentBar < 18) return;
  41. 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;
  42. this.bBS[0]=(item);
  43. double num = base.LinReg(this.bBS, 18)[0];
  44. this.bLinReg[0]=(num);
  45. this.diverMapVal[0]=(num);
  46. }
  47.  
  48. }
  49. }
RAW Paste Data