Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Indicater Value Output Window "n. def."

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

    Indicater Value Output Window "n. def."

    Hi guys!

    I programmed an indicator which I want to use as an entry signal in my strategy. If I let the indi run only on a chart with the output window open, everything works fine and I receive the right values from this indicator in the outputwindow.

    Then I implemented the indicator into my strategy. The rest of it worked fine so far. This I tested on a simple entry logic, wich I changed to a CrossAbove-logic using my indicator. I tested the strategy again in a proper part of a Replay file and despite the entry-condition was fulfilled, nothing happened, no entry!!

    So I wanted to print the indicator value into the output window to check, if it takes the right values. But I only get "n. def." as a result, no values. So I assume that's the reason, why there is no entry happening.

    How can that be? The indicator should take a value within the strategy as it does on the chart, no? I attached both the indicator and the strategy script.

    Please help me! thx
    Attached Files

    #2
    Hi koalboy,

    Not sure what you are facing on your end. I took your strategy and simply commented out the "if (Historical)..." part and ran it in a Strategy Analyzer.

    It started printing:
    Code:
    Value is 0.887155354676862
    Value is 0.727293395475504
    Value is 0.484862263650336
    Value is 10.0720447140767
    Value is 40.0480298093844
    It may be possible that in the beginning of your indicator it is unstable so the values have not been calculated out yet.
    Last edited by NinjaTrader_JoshP; 09-10-2008, 04:57 PM.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      To simulate Real-Time-Trading Environment I only test my strategies in Market Replay, not in the Strategy Analyzer which performs historical backtesting.


      I let the strategy run over several hours (with and without the [if historical, return] in a 1min BarChart but still the indicator doesn't take a value, so I don't think its because there are too less bars to calculate it, if you mean that regarding unstable period.

      I absolutely have no clue, what could cause this behaviour...

      Comment


        #4
        Try adding the indicator to the strategy for plotting and then running it again.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          What do you mean with "plotting"?

          I already put "Add(StochDSBressert(5, 10));" into the initalize section with no change in result...

          Comment


            #6
            I don't know why you are having problems since I am unable to reproduce on my end. I have tested on Simulated Data Feed and on a Market Replay.

            Code:
            Value is 174.07
            Value is 174.07
            Value is 174.07
            Value is 174.07
            Value is 174.06
            Value is 174.07
            Value is 174.07
            Value is 174.07
            Value is 33.3333333333333
            Value is 33.3333333333333
            Value is 33.3333333333333
            Value is 55.5555555555556
            Value is 55.5555555555556
            Attached Files
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              But the values still are not the same like shown in the chartpanel of the indicator!

              To find the error I programmed the whole indicator into the strategy and then printed every step of the Calculation from both scripts into the output window; from the indicator script and from the strategy script.

              It seems like NT cannot handle the 4th calculation step where an EMA is put on the "relPosA" - DataSeries. Up to this point both scripts generate the same values. I also tried to change the custom DataSeries to "Close[0]" and immediately it worked fine and genereated the right values.

              Actually it should be a simple exercise to get an custom indicator value into a strategy, but all my workarounds didn't work out. I even already reinstalled NT.

              I attached the files for you with the ammended codes. That's the way, how I did my testing: I first connect to a Market Replay file, then I open a Chart and insert the indicator. Afterwards I start the strategy and open the output window. I clear everything in the output window and then I start the replay.

              In the current NT-Manual (DownloadVersion) I found this point:
              "
              Improved: Woodies CCI Chopzone and Sidewinder plot values are now exposed for automated strategy development"

              Does that mean, I cannot use everey indicator for strategy developement?!?

              Also this thread in the forum might deal with a similar problem:
              "Indicator Plot v. Strategy Calculation problem" There is a stated, that it could be an NT-bug.

              Unfortunately I didn't achieve to code a workaround for the EMA-smoothing so far.

              Josh, what can you recommend? thx
              Attached Files

              Comment


                #8
                koalboy,

                I do not know why they are not matching for you. They are matching up perfectly for me on my end. This is from the version I attached earlier. No changes from what you sent me.

                Please see the screenshot. Make sure you are actually comparing the right bars.
                Attached Files
                Josh P.NinjaTrader Customer Service

                Comment


                  #9
                  I imported Version I again and didn't change anything...
                  Attached Files

                  Comment


                    #10
                    koalboy,

                    I am out of ideas. Just to make everything exactly the same between my end and your end try it on 1min chart of $EURUSD on this replay file. When you load the chart change BarsRequired to 1 or 0. Drop the attached replay into your My Documents\NinjaTrader 6.5\db\data.
                    Attached Files
                    Josh P.NinjaTrader Customer Service

                    Comment


                      #11
                      Hi Josh!

                      I tried to use your Replay file, but it doesn't contain data :-( - only one tick. So far I was also only testing on one single replay file, but now I tested some others and I get weird results.

                      I attached two replay files, recorded simultanously in frebruary and the settings for the strategy, all in the zip.

                      FGBS 03-08 -> that doesn't work ("Value is n. def.")
                      FGBX 03-08 -> that works (Output shows the correct Values according to the indicator from the chart)

                      I tried it several times on both instruments always with the same result.

                      By the way: in the simulation data feed it also works correct.

                      Both times I use identical setup for the strategy, I only changed the instrument. Minimum Bars required to 0, the rest should be set by the strategy itself - so no need for changes.

                      so I'm really puzzled. Is the same behaviour on your machine? What could be the problem? Is there some information in the replay file which is disturbing the strategy?

                      thx Karl
                      Attached Files

                      Comment


                        #12
                        Hi koalboy,

                        On my end both instruments work perfectly. Please ensure you are on NT6.5.1000.6 and that you are using .NET 2.0 without .NET 3.5 service pack 1 installed. Other than that I am completely out of ideas.
                        Josh P.NinjaTrader Customer Service

                        Comment


                          #13
                          This is what is stated under Menu ->Help -> About

                          Version 6.5.1000.6

                          .NET Version: 2.0.50727.1433


                          I just deleted the NET 1.0 stuff, which was still on my machine and made a restart. Then I tried the FGBS-replay again, but of course it didn't work. Attached the screenshot...
                          Attached Files

                          Comment


                            #14
                            There is also no NET 3.5 installed. Only NET 2.0 Service Pack 1 and several updates...

                            Comment


                              #15
                              Are you applying the strategy onto the chart or onto the Control Center strategies tab?
                              Josh P.NinjaTrader Customer Service

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                              0 responses
                              605 views
                              0 likes
                              Last Post Geovanny Suaza  
                              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                              0 responses
                              351 views
                              1 like
                              Last Post Geovanny Suaza  
                              Started by Mindset, 02-09-2026, 11:44 AM
                              0 responses
                              105 views
                              0 likes
                              Last Post Mindset
                              by Mindset
                               
                              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                              0 responses
                              560 views
                              1 like
                              Last Post Geovanny Suaza  
                              Started by RFrosty, 01-28-2026, 06:49 PM
                              0 responses
                              561 views
                              1 like
                              Last Post RFrosty
                              by RFrosty
                               
                              Working...
                              X