Guest User

Untitled

a guest
Jul 26th, 2021
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 3.44 KB | None | 0 0
  1. //
  2. // Copyright (C) 2015, NinjaTrader LLC <www.ninjatrader.com>.
  3. // NinjaTrader reserves the right to modify or overwrite this NinjaScript component with each release.
  4. //
  5. #region Using declarations
  6. using System;
  7. using System.Collections.Generic;
  8. using System.ComponentModel;
  9. using System.ComponentModel.DataAnnotations;
  10. using System.Linq;
  11. using System.Text;
  12. using System.Threading.Tasks;
  13. using System.Windows;
  14. using System.Windows.Input;
  15. using System.Windows.Media;
  16. using System.Xml.Serialization;
  17. using NinjaTrader.Cbi;
  18. using NinjaTrader.Gui;
  19. using NinjaTrader.Gui.Chart;
  20. using NinjaTrader.Gui.SuperDom;
  21. using NinjaTrader.Data;
  22. using NinjaTrader.NinjaScript;
  23. using NinjaTrader.Core.FloatingPoint;
  24. using NinjaTrader.NinjaScript.DrawingTools;
  25. #endregion
  26.  
  27. // This namespace holds all indicators and is required. Do not change it.
  28. namespace NinjaTrader.NinjaScript.Indicators
  29. {
  30.     public class aNT8ExposePlot : Indicator
  31.     {
  32.         private Series<DateTime> timeIndication;
  33.        
  34.         protected override void OnStateChange()
  35.         {
  36.             if(State == State.SetDefaults)
  37.             {
  38.                 Name                    = "aNT8ExposePlot";
  39.                 Calculate               = Calculate.OnBarClose;
  40.                 IsOverlay               = true;
  41.             }
  42.            
  43.             else if(State == State.Configure)
  44.             {
  45.    
  46.                 timeIndication          = new Series<DateTime>(this);
  47.             }
  48.         }
  49.  
  50.         protected override void OnBarUpdate()
  51.         {
  52.            
  53.             timeIndication[0] = Time[0];
  54.        
  55.         }
  56.  
  57.         // Important code segment in the Properties section. Please expand to view.
  58.         #region Properties
  59.         // Creating public properties that access our internal Series<bool> allows external access to this indicator's Series<bool>
  60.         [Browsable(false)]
  61.         [XmlIgnore]
  62.         public Series <DateTime> TimeIndication
  63.         {
  64.             get { return timeIndication; }  // Allows our public BearIndication Series<bool> to access and expose our interal bearIndication Series<bool>
  65.         }
  66.  
  67.  
  68.         #endregion
  69.     }
  70. }
  71.  
  72. #region NinjaScript generated code. Neither change nor remove.
  73.  
  74. namespace NinjaTrader.NinjaScript.Indicators
  75. {
  76.     public partial class Indicator : NinjaTrader.Gui.NinjaScript.IndicatorRenderBase
  77.     {
  78.         private aNT8ExposePlot[] cacheaNT8ExposePlot;
  79.         public aNT8ExposePlot aNT8ExposePlot()
  80.         {
  81.             return aNT8ExposePlot(Input);
  82.         }
  83.  
  84.         public aNT8ExposePlot aNT8ExposePlot(ISeries<double> input)
  85.         {
  86.             if (cacheaNT8ExposePlot != null)
  87.                 for (int idx = 0; idx < cacheaNT8ExposePlot.Length; idx++)
  88.                     if (cacheaNT8ExposePlot[idx] != null &&  cacheaNT8ExposePlot[idx].EqualsInput(input))
  89.                         return cacheaNT8ExposePlot[idx];
  90.             return CacheIndicator<aNT8ExposePlot>(new aNT8ExposePlot(), input, ref cacheaNT8ExposePlot);
  91.         }
  92.     }
  93. }
  94.  
  95. namespace NinjaTrader.NinjaScript.MarketAnalyzerColumns
  96. {
  97.     public partial class MarketAnalyzerColumn : MarketAnalyzerColumnBase
  98.     {
  99.         public Indicators.aNT8ExposePlot aNT8ExposePlot()
  100.         {
  101.             return indicator.aNT8ExposePlot(Input);
  102.         }
  103.  
  104.         public Indicators.aNT8ExposePlot aNT8ExposePlot(ISeries<double> input )
  105.         {
  106.             return indicator.aNT8ExposePlot(input);
  107.         }
  108.     }
  109. }
  110.  
  111. namespace NinjaTrader.NinjaScript.Strategies
  112. {
  113.     public partial class Strategy : NinjaTrader.Gui.NinjaScript.StrategyRenderBase
  114.     {
  115.         public Indicators.aNT8ExposePlot aNT8ExposePlot()
  116.         {
  117.             return indicator.aNT8ExposePlot(Input);
  118.         }
  119.  
  120.         public Indicators.aNT8ExposePlot aNT8ExposePlot(ISeries<double> input )
  121.         {
  122.             return indicator.aNT8ExposePlot(input);
  123.         }
  124.     }
  125. }
  126.  
  127. #endregion
  128.  
Advertisement
Add Comment
Please, Sign In to add comment