If I select tab2 that has no indicators then the indicator on tab 1 stops functioning.
if I wait a while and select tab1 again then it appears that the indicator catches up from where it left off.
I also notice the same thing if I switch between OPEN workspaces.
Is this as designed???
Tab1 has the indicator below that prints to the output window, alert window and a txt file. I tried the same thing with just the output window OR alert OR txt file. Same result.
Tab2 has no indicators.
public class PKTestTab1 : Indicator
{
protected override void OnStateChange()
{
if (State == State.SetDefaults)
{
Description = @"Enter the description for your new custom Indicator here.";
Name = "PKTestTab1";
Calculate = Calculate.OnPriceChange;
IsOverlay = true;
DisplayInDataBox = true;
DrawOnPricePanel = true;
DrawHorizontalGridLines = true;
DrawVerticalGridLines = true;
PaintPriceMarkers = true;
ScaleJustification = NinjaTrader.Gui.Chart.ScaleJustification.Right;
//Disable this property if your indicator requires custom values that cumulate with each new market data event.
//See Help Guide for additional information.
IsSuspendedWhileInactive = true;
}
else if (State == State.Configure)
{
}
}
protected override void OnBarUpdate()
{
Print(Time[0] + " \t" + Instrument.FullName + "\tPrice=" + Close[0]);
NinjaTrader.NinjaScript.Alert.AlertCallback(NinjaT rader.Cbi.Instrument.GetInstrument(Instrument.Mast erInstrument.Name), this, Instrument.MasterInstrument.Name + CurrentBar, NinjaTrader.Core.Globals.Now, Priority.Low, Time[0] + " \t" + this.GetType().Name + " \t" + " Print Line." + Time[0] + " " + Close[0] , NinjaTrader.Core.Globals.InstallDir + @"\sounds\Alert1.wav", new SolidColorBrush(Colors.Blue), new SolidColorBrush(Colors.White), 0);
File.AppendAllText(@"C:\Test.txt", Time[0] + " " + Close[0] + "\r\n");
}
}
So say I select Tab1 for a while, I will get the following:
8/2/2019 12:44:50 PM NFLX Price=315.2
8/2/2019 12:45:00 PM NFLX Price=315.31
8/2/2019 12:45:00 PM NFLX Price=315.35
8/2/2019 12:45:00 PM NFLX Price=315.34
8/2/2019 12:45:00 PM NFLX Price=315.3
8/2/2019 12:45:00 PM NFLX Price=315.38
8/2/2019 12:45:00 PM NFLX Price=315.39
8/2/2019 12:45:00 PM NFLX Price=315.3
8/2/2019 12:45:00 PM NFLX Price=315.29
8/2/2019 12:45:10 PM NFLX Price=315.29
8/2/2019 12:45:10 PM NFLX Price=315.27
8/2/2019 12:45:10 PM NFLX Price=315.23
8/2/2019 12:45:10 PM NFLX Price=315.26
8/2/2019 12:45:10 PM NFLX Price=315.23
8/2/2019 12:45:10 PM NFLX Price=315.19
8/2/2019 12:45:10 PM NFLX Price=315.09
8/2/2019 12:45:20 PM NFLX Price=315.27
If I select Tab 2 I get nothing.
If I wait a while and select Tab1 it catches up with what it missed.
8/2/2019 12:45:50 PM NFLX Price=315.27
8/2/2019 12:46:00 PM NFLX Price=315.29
8/2/2019 12:46:10 PM NFLX Price=315.45
8/2/2019 12:46:20 PM NFLX Price=315.45
8/2/2019 12:46:30 PM NFLX Price=315.53
8/2/2019 12:46:40 PM NFLX Price=315.45
8/2/2019 12:46:50 PM NFLX Price=315.51
8/2/2019 12:47:00 PM NFLX Price=315.54
8/2/2019 12:47:10 PM NFLX Price=315.59
8/2/2019 12:47:10 PM NFLX Price=315.6
8/2/2019 12:47:10 PM NFLX Price=315.62
8/2/2019 12:47:10 PM NFLX Price=315.63
8/2/2019 12:47:20 PM NFLX Price=315.6
8/2/2019 12:47:20 PM NFLX Price=315.63
8/2/2019 12:47:20 PM NFLX Price=315.66
That means that I won't get any alerts or if I draw something on Tab2 then a custom indicator that looks at drawn objects on Tab1 won't see it until I switch back.
SO BUG OR AS DESIGNED??????
thx,
Peter
Comment