Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Missing Indicator Signal

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

    Missing Indicator Signal

    Hello Support,

    My Strategy calls Indicator that give trade signals. Lets just say it has Longentry and Shortentry signals. It works well, I plot the signal on the Indicator, calling LgSignal.Set command when longentry signal is given, and LgSignal.Reset when no longsignal is given, on each BarUpdate. And on the Strategy signals are detected calling condition testing Indicator.LgSignal.ContainsValue(0), I print out the signals, they match up. However, not often but every now and then, a signal is missed. Ie. It is shown on my Indicator but the Strategy debugging tell me, ContainsValue test returning false.

    Further, during debugging, I found, even when a signal is detected at Strategy, on the same BarUpdate, Reset values are detected within same BarUpdate. I included herewith a Indicator Plots showing three signals, Ex5, ExL1, EnL7. And Strategy output showing prints at each OnBarUpdate. I also print out the signals when containsvalue return false. Ie. the value of signal.Reset().

    My questions:
    1. How could signal EnL7 be missed?
    2. Why is reset values detected during the same OnBarUpdate when valid signal is given?
    My Strategy code does not execute print value of same direction when containsvalue already return true so this seems to suggest it can only happens, if OnBarUpdate routine is called twice on each BarUpdate.

    I hope your answer would give me a good understanding to solve the issue.

    Thanks.

    Regards.
    Edwardk.
    Attached Files

    #2
    Hi Edward Kunafi,

    Let's start here...

    Please use Print() statements in all of your code blocks to see if the code is indeed entering your condition for the signal?


    Is it possible that your signals are being reached, but the order ignored or cancelled for some reason? You can track this with TraceOrders
    TimNinjaTrader Customer Service

    Comment


      #3
      Hello Tim,

      The Strategy will test each signal contains value, if given then show it in print. If it does not contain value, I still prints it out in the Else portion. What is there to check whether my code executes or not. It is done in sequence, no other testing.

      There is no need to trace orders, because this is early part of the strategy, just getting the signals. Not the processing and depatching orders which comes later.

      Thanks.

      Regards.
      EdwardK.

      Comment


        #4
        Originally posted by Edward Kunafi View Post
        1. How could signal EnL7 be missed?
        If you are not sending entries, can you please clarify this?
        TimNinjaTrader Customer Service

        Comment


          #5
          Hello Tim,

          In the previously attached IndicatorPlot, you can see on Panel #2,
          one Green hash for ExS5
          one Red hash for ExL1
          one Cyan dot for EnL7
          These are the signals sent out by the Indicator.

          Please disregard question 2 in my original post, The Reset values are for the En (entries) series, I did not print the Ex series, so there is no suspicion of double calling of OnBarUpdate routine. But non detection of EnL7 in this case is still an issue.

          Thanks.
          Regards.
          EdwardK

          Comment


            #6
            Hi Edward Kunafi,

            Thanks for clarifying the attachment, however I am still unsure why you suspect the "non detection of EnL7".

            How is this being detected? How do the results differ from what you expect?
            TimNinjaTrader Customer Service

            Comment


              #7
              Hello Tim,

              My Strategy called the Indicator, get the signal values, by first checking "ContainsValue", then get the actual value. For example:
              If (Indicator(...).EnterLong.ContainsValue(0))
              LongEntrySignal = Indicator(...).EnterLong[0].

              EnL7 is EnterLong7 is not detected by the Strategy in this case. Ie. ContainsValue return false, and if I check EnterLong[0], it gives the Reset(0) value.
              The same method is used for Exits. This does not happen often but I need to fix it.

              The indicator plots EnL7, so the Strategy should get it, ContainsValue should return true.

              Thanks.

              Regards.
              EdwardK

              Comment


                #8
                Hi Edward Kunafi,

                Thank you for the update, do you see any errors in the Log tab of the Control Center when applying the strategy?
                TimNinjaTrader Customer Service

                Comment


                  #9
                  Hello Tim,

                  There is no issue reported on the log tab.

                  Anyway I add the plots from within the strategy. On the chart, I have the two plots of the same indicator, one plotted from within strategy and another added to the chart. They both have exactly the same parameter settings. To my surprise, the plots from Strategy is showing missing Entries. Occasionaly, but much less frequent it is the other way around. To cut the story short, it seems to have been caused by entry filters that rely a lot on double comparisons.

                  So anyway to solve this?
                  Is there functions that can achieve double substractions and comparisons to pre-determined precision and guarantee same results. I do not want to re-invent the wheel, NT support would probably have such proven functions.

                  Thanks.

                  Regards.

                  EdwardK.

                  Comment


                    #10
                    Edward, for dealing with those problematic double value comparison we have a dedicated tip available to goes into the details needed to solidify your code - http://www.ninjatrader.com/support/f...ead.php?t=3929

                    Comment


                      #11
                      Hello,

                      Upon further debug, I found there is issue si not on the double operations, but instead I found this:
                      The instrument is $GBPUSD, with half pips setting on IB, so TickSize is 0.00005
                      1. On the Indicator on the chart, the TickSize is correct, at 0.00005
                      2. On the Strategy added plot indicator, the TickSize is incorrect at 0.01
                      This cause the double operation results to be different, resulting in no Entry signals.
                      Oh, my, that is something I do not suspect.
                      What is the cause? and How can I fix it?
                      Anything to set on the Strategy to get the correct TickSize?

                      Thanks.

                      Regards.

                      EdwardK.

                      Comment


                        #12
                        Hello,

                        I manage to solve it by moving the relevant code that uses TickSize to OnBarUpdate, from Initialize. The HelpGuide say TickSize should not be used at Initialize, it probably has got the correct value till later. But somehow on Standalone Indicator it is ok, but on Strategy added indicator, the TickSize is wrong at Initialize.

                        Both Indicator plots now generate the same Signals.

                        Regards.

                        EdwardK.

                        Comment


                          #13
                          Edward, glad to hear you've got it figured out. As you've correctly noted, it is not advised to use TickSize in Initialize().
                          AustinNinjaTrader Customer Service

                          Comment


                            #14
                            Wrongly Placed Indicator Signal in a Strategy

                            Hello Austin,

                            Yes, really glad that was resolved.

                            Now I notice another issue, a particular entry6, appears at wrong place. Please see attached picture. I take liberty to post on the same thread for sake of continuity.

                            On Panel 1, the first EnS6 are given by Strategy added plot, occurs at price level 0.91400 (The signal given by indicator is at panel 3, is shown as Pink Dot). This is ahead of the second EnS6, at price level 0.91360, which is given by Indicator added on the chart manually (The signal given by indicator is at Panel 2, again the Pink Dot), The second EnS6 is correct as price cross the Red Dots level on panel 1.

                            Why is Signal given when the price level has not cross 0.91360, so then I added the RedDots plot onto the Strategy, and plot it on panel 4. That level is 0.91400!! But If I show it on Panel1 that level is 0.91360!! But look at the move down of the Red Dots on Panel4, it occurs only two bar later at 0.91400, but the price close on that bar time is at 0.91360 already! So my conclusion is that those Red Dots on panel 4 are Time Displaced by 2 bars!

                            This is strange behaviour. (Notice there is two separate issues, first the red dots on panel 4 should not have been at 0.91400, second issue the the time displacement)What is really happening? What is the cause ? Why would it be different when plotted at different panel? From strategy how can we enforce displacement is 0?

                            Is there another hidden gem from the helpguide, kindly enlighthen me.

                            No TickSize at Initialize.

                            Thanks.

                            Regards.

                            EdwardK
                            Attached Files

                            Comment


                              #15
                              EdwardK, we will get back to you tomorrow.
                              AustinNinjaTrader Customer Service

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                              0 responses
                              647 views
                              0 likes
                              Last Post Geovanny Suaza  
                              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                              0 responses
                              369 views
                              1 like
                              Last Post Geovanny Suaza  
                              Started by Mindset, 02-09-2026, 11:44 AM
                              0 responses
                              108 views
                              0 likes
                              Last Post Mindset
                              by Mindset
                               
                              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                              0 responses
                              572 views
                              1 like
                              Last Post Geovanny Suaza  
                              Started by RFrosty, 01-28-2026, 06:49 PM
                              0 responses
                              573 views
                              1 like
                              Last Post RFrosty
                              by RFrosty
                               
                              Working...
                              X