Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Same indicators - different results

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

    Same indicators - different results

    I have ported all of my indicators and strategies to NT7b3. I get a clean compile, and most things look fine (have not checked all yet).

    One indicator has me puzzled. It calculates the Mode based on the distribution of trades within a bar. This plots a magenta line on the price bars, and works fine. (Both 6.5 and 7b3)

    Another Indicator calls the 1st one and plots a Tan line, 1/2 Tick, above the 1st.

    This works fine in 6.5 but not 7b3. See attached images for sample charts. The Tan line should always be 1/2 Tick above the Magenta.
    [1] is 6.5, and [2] is 7b3

    I've narrowed it to a branch, in Indicator #1, based on Historical.
    in 6.5 - When indicator 2 calls Indicator 1, the returned value comes from the branch as expected, based on whether the data is Historical or not
    in 7b3- When indicator 2 calls Indicator 1, the returned value always comes from the else branch.

    Am I missing something about the way Historical works?

    Structure of Indicator #1

    if( ! Historical )
    {
    calculate Mode
    return Mode
    }
    else
    return Typical[0]

    Code of Indicator #2
    protected override void OnBarUpdate()
    {
    double ModeCheck = QT_Mode()[0]+(TickSize/2);
    Values[0].Set(ModeCheck);
    }
    Attached Files

    #2
    Please ensure that Update() method is called in any indicator method that returns a value.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Well OK, but the the same code (copied between 6.5 and 7 directories) works differently.

      I'm still at a loss, I can't find any reference in the Code- Breaking changes that apply.

      Where do I start?

      Comment


        #4
        tquinn,

        Could very well be the case. 6.5 scripts need to be converted to be 7 compatible. The reference is in the strategies section, but it can be applied in this instance too. You will need to call Update().
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          Josh,
          Do I need to call Update(), to access the indicator primary value "Value"?
          How do I do that?
          Last edited by tquinn; 10-28-2009, 12:12 PM.

          Comment


            #6
            tquinn,

            Believe you would have some plots defined in Properties. They need Update()s
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              I left for a month and forgot everything, I once knew. What is NT used for again?

              I still cannot get the correct values passed from this indicator. I'll noodle on it some tonight, and try again tomorrow with you, if needed.

              Comment


                #8
                Values[0] are automatically updated and don't need a forced call to Update() method. Its when you expose internal values as a property that you want to include a call to Update() in the property 'getter'.
                RayNinjaTrader Customer Service

                Comment


                  #9
                  OK,

                  I've rewritten the indicator, copied back to 6.5, and it is OK. Update(), makes no change. I still cannot get it to work in 7b3.

                  There is something going on, which I don't understand. Either NT7b3 is wrong, or I don't understand some precept which changed from 6.5 to 7. I assume it is my lack of understanding.

                  I have an indicator (A) which plots a single value. [CalculateOnBarClose=false]
                  In that indicator I placed Print statements to show the value of the variable which is assigned to the "Primary Value". This Prints once per bar on FirstTickOfBar. (It is actually the last calculated value of the prior bar)

                  I have a second indicator (B) which calls (A) [CalculateOnBarClose=true]
                  it adds 1/2 Tick then replots. With these two indicator added to a chart I should have 2 parallel Lines, separated by a half tick.

                  Now in the Output window I get 2 blocks of data, 1 from (A), and 1 from (B)
                  Now comparing those blocks:

                  From 6.5 - Output[5], They match (as I expected)
                  same TimeStamp, same BarNumber (3576), same FoundMode (1058.25)

                  From 7b3 - Output[5], They do NOT match
                  same TimeStamp, But, DIFF BarNumber (3178, 3177), and DIFF FoundMode (1058.5, 2584)

                  The 2584 is actually the Volume parameter - these are on (2584 Volume charts), which is confusing the Value should be Price not volume.

                  From 7b3 - Output[5] with [CalculateOnBarClose=false]
                  I get 3 blocks of data, I don't understand why 3.
                  same TiimeStamp, same BarNumber, but DIFF FoundMode
                  Attached Files
                  Last edited by tquinn; 10-29-2009, 12:39 PM.

                  Comment


                    #10
                    tquinn, thank you for your patience on this issue. I'll be taking a look at what is going on here along with Josh. Can you please post the code you're using that causes the unexpected behavior?
                    AustinNinjaTrader Customer Service

                    Comment


                      #11
                      The issue of Different values printing, where one was the volume was my coding error.

                      However I still don't get the same results between 7b3 and 6.5

                      BTW, the results are much closer (maybe correct) if (B) is set to CalculateOnBarClose=false.

                      Maybe I should rewrite (A) to use OnMarketData, and set it to CalculateOnBarClose=true?
                      Attached Files
                      Last edited by tquinn; 10-30-2009, 07:56 AM.

                      Comment


                        #12
                        tquinn,

                        What exactly are you trying to do with VerifyMode_A? I suggest you try real simple examples to establish a base case then layer on complexity layers.
                        Josh P.NinjaTrader Customer Service

                        Comment


                          #13
                          Josh,
                          That indicator tallies the volume of trades at each tick, and returns the tick with the highest volume.

                          I rewrote the indicator using OnMarketData() and it works now. Better than the 6.5 version since using OnMarketData() is a better programming choice for this indicator.

                          I guess I misunderstood the reason for beta testing. I thought the real issue was the fact that the indicator works differently in 7b3 than it did in 6.5, not what the indicator was designed to do.

                          Comment


                            #14
                            tquinn,

                            6.5 indicators may or may not work in 7 due to code changes. To isolate if there truly is something that is fundamentally different and undocumented we would need to isolate the base case scenario of that change. Unfortunately we will not be able to dissect complex code samples. Thank you for your efforts.
                            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
                            625 views
                            0 likes
                            Last Post Geovanny Suaza  
                            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                            0 responses
                            359 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
                            562 views
                            1 like
                            Last Post Geovanny Suaza  
                            Started by RFrosty, 01-28-2026, 06:49 PM
                            0 responses
                            567 views
                            1 like
                            Last Post RFrosty
                            by RFrosty
                             
                            Working...
                            X