testBreakout.cs | The type or namespace name 'ActivitySource' could not be found (are you missing a using directive or an assembly reference?) | CS0246 | 30 | 18 |
#region Using declarations using System; using System.Collections.Generic; using System.ComponentModel; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Input; using System.Windows.Media; using System.Xml.Serialization; using NinjaTrader.Cbi; using NinjaTrader.Gui; using NinjaTrader.Gui.Chart; using NinjaTrader.Gui.SuperDom; using NinjaTrader.Gui.Tools; using NinjaTrader.Data; using NinjaTrader.NinjaScript; using NinjaTrader.Core.FloatingPoint; using NinjaTrader.NinjaScript.DrawingTools; #endregion using System.Diagnostics; //This namespace holds Indicators in this folder and is required. Do not change it. namespace NinjaTrader.NinjaScript.Indicators { public class testBreakout : Indicator { private bool longwind,shortwind; private static ActivitySource activitySource = new ActivitySource( "companyname.product.library", "semver1.0.0"); protected override void OnStateChange() { if (State == State.SetDefaults) { Description = @"Enter the description for your new custom Indicator here."; Name = "testBreakout"; Calculate = Calculate.OnEachTick; IsOverlay = false; DisplayInDataBox = true; DrawOnPricePanel = true; DrawHorizontalGridLines = true; DrawVerticalGridLines = true; PaintPriceMarkers = true; ScaleJustification = NinjaTrader.Gui.Chart.ScaleJustification.Right; MaximumBarsLookBack = MaximumBarsLookBack.Infinite; //Disable this property if your indicator requires custom values that cumulate with each new market data event. //See Help Guide for additional information. IsSuspendedWhileInactive = false; AddPlot(new Stroke(Brushes.Orange, 2), PlotStyle.Block, "TradeWindsLong"); AddPlot(new Stroke(Brushes.Blue, 2), PlotStyle.Block, "TradeWindsShort"); } else if (State == State.Configure) { AddDataSeries(BarsPeriodType.Second, 1); AddDataSeries(BarsPeriodType.Day, 1); } } protected override void OnBarUpdate() { { using (var activity = activitySource.StartActivity("ActivityName")) { ///very complex operation } } } #region properties [Browsable(false)] [XmlIgnore] public Series<double> TradeWindsLong { get { return Values[0]; } } public Series<double> TradeWindsShort { get { return Values[1]; } } #endregion } }
Comment