Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Databox doesn't show indicator value

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

    Databox doesn't show indicator value

    Hi,

    I have scripted an indicator that can have values -1, 0 or 1.
    If it recognizes certain patterns it has values different from zero
    and draws lines and triangles on the chart.

    On certain occations (recompiling, doing small nonrelevant changes in the script)
    the Data Box doesn't show the correct indicator value, it shows zero if it's supposed
    to show 1 or -1. Everything else works, Drawing objects are still placed and if I print
    Plot0[0] in the output window it's valures are correct as well. There are no error messages in the output window and the log-File. Looks like a pretty weird NT bug.

    After closing NT and reopening it, it worked fine again. However, after some actions
    it started to display false indi values again.

    Is this an already known bug or might it be due to erroneous code in the indi script and does anybody know how to get rid of it?

    #2
    Hello,

    Not a known bug currently.

    Do you know how to take a video? If so can you do a screen capture using jing for example and post the link here with the steps you take to cause this too occur as this seeems very strange.

    I look forward to assisting you further.

    Comment


      #3
      Right now I see both correct and wrong values in the databox within the same chart.

      I did some screenshots.
      The first shot shows 2 charts. Primary Chart is ^NYA daily, second chart is ^DAX_TXT daily. I applied the indicator divergence3 to it. What thze script did was
      1) adding a second instrument, ^DAX_TXT
      2) evaluating primary and secondary dataseries and checking for certain conditions.
      3) If conditions are met, assigning -1 or 1 to Plot0 and drawing objects in the primary chart

      First pic shows a bar where the wrong value is shown for Plot0 in the data box. It shouldn't be zero there.
      2nd pic shows a bar where the correct value is shown in the databox.

      I inserted the following code into the indicator script:

      Code:
      Plot0.Set(indiwert);
       if (ToDay(Times[0][0])==19920215)
       {Print(indiwert);}
      The date chosen is the same as in pic1, when display didn't work.
      The output window now shows 3(!) values. -1, 0 and 0 again.
      It's supposed to show -1 only.
      There are no other Print()-commands within the indicator script.

      The script is applied in backtests only. It handles a primary and an added chart. I didn't use any BarsInProgress commands. Don't know if this causes the weird behaviour.

      Click image for larger version

Name:	Shot1.jpg
Views:	1
Size:	94.7 KB
ID:	861938

      Click image for larger version

Name:	Shot2.jpg
Views:	1
Size:	92.2 KB
ID:	861939

      Click image for larger version

Name:	Shot3.jpg
Views:	1
Size:	8.8 KB
ID:	861940

      Comment


        #4
        Hello,

        Is this a multi series script?

        If this is the case could be part of the issue.

        Please try removing the secondary series in the data series on the chart.

        It is not needed for the indicator to run in multi series and I want to check if this clears anything up.

        I look forward to assisting you further.

        Comment


          #5
          It's a multiseries indicator script.
          I deleted the second series within the chart, indicator behaviour is still the same.
          False values in the databox, 3 entries in the output window.

          Just read that it's adviced to asign indicator values only by using BarsInProgress==0.
          Why is this? I didn't do that. Didn't use BarsInProgress at all. I used BarsArray and
          Closes to adress the series I want, assuming correct values would be there when the OnBarUpdate method is called. I seems to work properly this way, just the indicator values are not correctly assigned or are assigned three times at the same bar.

          Comment


            #6
            Hello,

            Right. Your problem then in this case is most likely due to you not using BarsInProgress Filter.

            OnBarUpdate is called for each instrument and will change your values if you have it coded in this fashion.

            You do need the BarsInProgress filter to correct this.

            Comment


              #7
              If using BarsInProgress==0 applied to the whole indicator script-
              does it always give correct values for BarsArray[1] [0]
              and Closes[1][0]?
              Any difference in this case between CalculateOnBarClose=true and
              CalculateOnBarClose=false?

              Comment


                #8
                Hello,

                Yes this should do what you want and eliminate your bad set of data series from a secondary data series.

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by traderqz, Today, 12:06 AM
                10 responses
                18 views
                0 likes
                Last Post traderqz  
                Started by algospoke, 04-17-2024, 06:40 PM
                5 responses
                46 views
                0 likes
                Last Post NinjaTrader_Jesse  
                Started by arvidvanstaey, Today, 02:19 PM
                1 response
                6 views
                0 likes
                Last Post NinjaTrader_Zachary  
                Started by mmckinnm, Today, 01:34 PM
                3 responses
                5 views
                0 likes
                Last Post NinjaTrader_ChelseaB  
                Started by f.saeidi, Today, 01:32 PM
                2 responses
                9 views
                0 likes
                Last Post f.saeidi  
                Working...
                X