Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Market Analyzer Columns missing some alerts

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Market Analyzer Columns missing some alerts

    I have a case where some alerts fail to show up in the Alerts window even though clearly the they are showing up in the chart and Market Analyzer.

    Market Analyzer Column Properties:

    New Column set to Indicator "CustomA" on ES 12-16, 5 min,
    New Column set to Indicator "CustomA" on ES 12-16,1000 volume.

    Both are set to calculate on Bar Close.
    1 Buy Alerts (Signal > 0) and 1 Sell Alert (Signal < 0) are each set to calculate on Bar Close and re-arm on bar close.

    Inside the "CustomA" indicator:
    Calculate = Calculate.OnBarClose;
    IsSuspendedWhileInactive = false; (set within State = Configure).

    The "CustomA" indicator signals = 0 for 90% of the the time, >0 for Buy and <0 Sell.

    The Alerts window is configured to show 2 Columns: Time and Message and the alert sources set to all.

    Symptoms:

    1) A non-zero signal becomes visible in the indicator's panel on the chart as the previous bar closes.
    2) The Market Analyzer column properly shows the signal value as non-zero in the added Column.
    3) The alerts Window _sometimes_ does not show a new alert row.


    Any ideas? Thanks,
    Chris

    #2
    Hello,

    Thank you for the post.

    Can you tell me, is the Alert in the same condition that sets the non zero value? As I have not seen the logic used it would be difficult to say what may be happening at this point. If you can provide any more details on the condition triggering the alert that may shed some light on what is happening.

    Also because you had mentioned IsSuspendedWhileInactive , are you using another workspace when this occurs?

    One item you could try would be to make a simple test script that has a single condition and that condition triggers an alert and Print along with the Time. You could compare the Prints times to the Alert times to see if any are missing. If you are able to see the same outcome or sometimes the alert is listed and sometimes not, I would like to see the script in addition to the steps you had used for testing.

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Hi Jesse,

      I posted an image which was created using a sample indicator. It shows how the alerts aren't matching what is seen in the chart (300 Volume ES 12-16).



      Maybe it is related to how volume bars work--Is there some skew as to the starting point?

      However, in the Indicator code (core shown below) if I look in the log file where the Dbg.WriteLines() are going I don't see duplicate indicators running so it appears just 1 instance of the indicator is being shared by the M.A. and Chart. But yet the answers aren't matching. Thoughts?

      As far as setting IsSuspendedWhileInactive, my understanding was that if the chart was on a backgrount tab (in same workspace) then Alerts would not be generated so I set it to false to try and rule that out.

      Code:
      ...		        
                      Stroke stroke = new Stroke(Brushes.Gray, 2);
                      AddPlot(stroke, PlotStyle.Bar, "Result");
      			}
      			else if (State == State.Configure)
      			{              
                      IsSuspendedWhileInactive = false; 
      			}
      
                   protected override void OnBarUpdate()
      		{
                 // Dbg.WriteLine0("TI2:  CB = " + CurrentBar + ", Bars.PercentComplete = " + Bars.PercentComplete);
                  
                  if (CurrentBar % 5 == 0)
                  {
                      if (CloseEndsWithCents(0))
                          Result[0] = 1;
                      else if (CloseEndsWithCents(.25))
                          Result[0] = 2;
                      else if (CloseEndsWithCents(.5))
                          Result[0] = -2;
                      else if (CloseEndsWithCents(.75))
                          Result[0] = -1;
                      else
                          Result[0] = 5; // shouldn't happen                       
                  }
                  else
                      Result[0] = 0;
      		}
      
              private bool CloseEndsWithCents(double cents)
              {
                  double priceCents = Close[0] - (int)Close[0];
                  return Math.Abs(cents - priceCents) < .001;
              }

      Comment


        #4
        Hello,

        I wanted to check, are you currently comparing the alerts that are generated from the MA column against the Chart?

        If so, are you using a number of Bars rather than Days to load? This would be specially important for the MA to see the same data as the chart is. Otherwise I would not expect these tools to match up for a Indicators value exactly.

        The purpose of IsSuspendedWhileInactive would be to suspend the script when inactive, but that is not quite the same as the Alerts window reporting as this would by default only report alerts for the parent workspace. If you are using multiple workspaces, you would need to ensure to review the section "Alerts Logs in Multiple Workspaces" http://ninjatrader.com/support/helpGuides/nt8/en-us/





        I look forward to being of further assistance.
        JesseNinjaTrader Customer Service

        Comment


          #5
          I've been trying to get all 3 items (chart, MA, Alerts) to be in sync. When the last bar a of chart shows a signal, I've been expecting the MA to show the same signal value and an alert would be generated. Does that sound right?

          For volume bars I have been using BarsToLoad because days loads way to many bars for lower volumes. To get them in sync which to use bars or day?

          IsSuspendedWhilInactive. Well I don't currently use multiple Workspaces so maybe its overkill to set I saw the part about tab being inactive which I do have so figured it couldn't hurt too much while debugging this alert issue. https://ninjatrader.com/support/help...leinactive.htm

          Is there a note somewhere about how the caching / sharing indicators works. Specifically the auto-generated cache Key comparison code within each indicator includes comparison of the (1) input series and the (2) Input Properties. But it does not seem to include some other side effect parameters things that could affect the indicator result such as BarsToLoad (as you pointed out), MaxLookback, CalculateOnBarClose., and others?

          Say for example, if two charts are setup with the exact same series and indicator, but have different CalculateOnBarClose values, will the charts share the same indicator instance? The answer should apply to this case involving M.A. and Chart I assume.

          Thanks,
          Chris
          Last edited by crokusek; 09-29-2016, 10:20 AM.

          Comment


            #6
            Hello,

            For syncing the chart with the MA, there are a few factors that come into play when syncing. First would be the data source, for both the chart and MA, they would need to exactly match for the data settings.

            Using an amount of BarsToLoad is generally the easiest to specify exactly the amount of bars so that both match for the number of bars. The Session template and CalculateOnBarClose setting are also important.

            The easiest way to ensure that the values are happening in sync would be to apply a standard item like the SMA and ensure all settings are the same between the windows. Next check that the current bars value is the same in both windows. When you are able to see the same values, you could apply these steps to check your custom indicator next.

            Additionally how the indicator is programmed can play a role, for example if the indicator uses live Tick data there could potentially be cases where one window loads before the other causing different data to be used.

            As far as I am aware there are not notes related to caching. The NinjaScript generated code would check if the data being used is different I.E. the series or if the overloaded parameters are different. Settings like CalculateOnBarClose would not factor into this because only the items listed in the generated code would matter in regard to the cache. The logic of the indicator will still be executed on each instance based on the settings used and instances would not be shared between charts.

            I look forward to being of further assistance.
            JesseNinjaTrader Customer Service

            Comment


              #7
              Hi Jesse,

              Thanks for the information. I was able to verify some points. The setup was to have a chart and M.A. use the same indicator with same input parameters but with a different number of bars to load (1000 Volume).

              1) The Chart and M.A. each use separate instances of the indicator. In the trace output below, the first number in ()'s is the hash code instance.

              2) There are small discrepancies in the values. See BarsSinceNtd=260 Close value below:

              TI2 (60980734): Volume 1000CB = 376, BarsSinceNtd = 257, OHLC[1]: 2173.75 2174 2173.5 2173.75 v1
              TI2 (48309817): Volume 1000CB = 647, BarsSinceNtd = 257, OHLC[1]: 2173.75 2174 2173.5 2173.75 v1

              TI2 (48309817): Volume 1000CB = 648, BarsSinceNtd = 258, OHLC[1]: 2173.75 2174 2173.5 2174 v1
              TI2 (60980734): Volume 1000CB = 377, BarsSinceNtd = 258, OHLC[1]: 2173.75 2174 2173.5 2174 v1

              TI2 (60980734): Volume 1000CB = 378, BarsSinceNtd = 259, OHLC[1]: 2174 2174.5 2174 2174.5 v1
              TI2 (48309817): Volume 1000CB = 649, BarsSinceNtd = 259, OHLC[1]: 2174 2174.5 2174 2174.5 v1

              TI2 (48309817): Volume 1000CB = 650, BarsSinceNtd = 260, OHLC[1]: 2174.5 2175 2174.25 2174.5 v1
              TI2 (60980734): Volume 1000CB = 379, BarsSinceNtd = 260, OHLC[1]: 2174.5 2175 2174.25 2174.75 v1

              TI2 (48309817): Volume 1000CB = 651, BarsSinceNtd = 261, OHLC[1]: 2174.5 2175.25 2174.25 2175.25 v1
              TI2 (60980734): Volume 1000CB = 380, BarsSinceNtd = 261, OHLC[1]: 2174.75 2175.25 2174.25 2175.25 v1

              TI2 (48309817): Volume 1000CB = 652, BarsSinceNtd = 262, OHLC[1]: 2175.25 2175.25 2174.75 2175 v1
              TI2 (60980734): Volume 1000CB = 381, BarsSinceNtd = 262, OHLC[1]: 2175.25 2175.25 2174.75 2175 v1

              Now if the BarsToLoad are exactly the same, the M.A. and Chart still use separate instances. I didn't notice any discrepancies in the values (in a small 50 points sample).

              Of course it would be nice if the volume bars would automatically line up based on some time of day but I realize this might be difficult.

              Now here might be a bug... Say the M.A. contains a column of some indicator and that column has some alerts set up on it that are working. Then if the column label is changed the alerts will no longer trigger. The condition just needs to updated to use the new column name. It might be nice to automatically change the connected alerts when the label changes because its kind of confusing how it just stops working.

              Its likely my original problems were related to these issues.

              Thanks,
              Chris


              The test indicator:

              Comment


                #8
                Hello,

                Thank you for the reply.

                In your scenarios I would expect what you have described or that the number of BarsToLoad had matched but the Volume bars did not. The volume bars are tick based so with this unfortunately there could be differences as the tools are likely to start at different times.

                Regarding the column label, I will look further into this to see if this is a bug or item I would need to feature request, either way I will look further into this.

                I look forward to being of further assistance.
                JesseNinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by jxs_xrj, 01-12-2020, 09:49 AM
                6 responses
                3,290 views
                1 like
                Last Post jgualdronc  
                Started by Touch-Ups, Today, 10:36 AM
                0 responses
                8 views
                0 likes
                Last Post Touch-Ups  
                Started by geddyisodin, 04-25-2024, 05:20 AM
                8 responses
                61 views
                0 likes
                Last Post NinjaTrader_Gaby  
                Started by Option Whisperer, Today, 09:55 AM
                0 responses
                8 views
                0 likes
                Last Post Option Whisperer  
                Started by halgo_boulder, 04-20-2024, 08:44 AM
                2 responses
                24 views
                0 likes
                Last Post halgo_boulder  
                Working...
                X