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

Property "Historical" not passed to referenced indicator

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

    Property "Historical" not passed to referenced indicator

    Hello!
    My indicator doesn't pass to he property "Historical" to another referenced indicator in Market Replay, as is the case with the COBC property. The calling indicator has Historical = false, while the called indicator has Historical = true in Market Replay. Any idea how this can be?

    // Best Regards
    Poseidon_Sthlm

    #2
    Poseidon_Sthlm, please try removing the statement in the called indicator completely and then only set this from the 'caller'.
    BertrandNinjaTrader Customer Service

    Comment


      #3
      I actually don't set the property Historical in any indicator. I just make a check "if ( Historical)"

      But I belive that I have now located the issue. It occurs when the calling indicator uses the IDataSeries overload with another indicator when calling the referenced indicator in real time. My custom indicators, the caller and as well as the callee, are only recalculated on FirstTickOfBar for reasons of CPU optimization. This issue where the property Historical returns true for the called indicator in real time, doesn't occur if one pass an IDataSeries of High, Low or Close to the callee. It only occurs when passing and IDataSeries of another indicator to the callee.

      I have attached the indicators (with print statments) of this simplified example below, so you easily can reproduce this issue if you wish.

      This Code (IDataSeries overload = indicator)...
      Code:
        
          public class TestReferencingSMACOBC : Indicator
          {
            private SMACOBC mySMACOBC;            //Declare indicator    
              
              protected override void OnStartUp()
              {    
                  mySMACOBC = SMACOBC([U]Range().Value[/U], period); // Instanciate indicator
              }
      }
      ...generates this print output in Market Replay:

      Code:
      TestReferencingSMACOBC (Caller)
      ************************************************************************
      2011-04-11 06:10:00
      CurrentBar: 1
      CalculateOnBarClose: False
      Historical: False
      x: 1
      ************************************************************************
      
      SMACOBC (Callee)
      ************************************************************************
      1800-01-01 00:00:00
      CurrentBar: 0
      CalculateOnBarClose: False
      Historical: [B][COLOR=Red]True[/COLOR][/B]
      x: 0
      ************************************************************************
      This Code...(IDataSeries overload = High)
      Code:
        
          public class TestReferencingSMACOBC : Indicator
          {
            private SMACOBC mySMACOBC;            //Declare indicator    
              
              protected override void OnStartUp()
              {    
                  mySMACOBC = SMACOBC([U]High[/U], period); // Instanciate indicator
              }
      }
      ...generates this print output in Market Replay:

      Code:
      TestReferencingSMACOBC (Caller)
      ************************************************************************
      2011-04-11 06:10:00
      CurrentBar: 1
      CalculateOnBarClose: False
      Historical: False
      x: 1
      ************************************************************************
      
      SMACOBC (Callee)
      ************************************************************************
      2011-04-11 06:10:00
      CurrentBar: 1
      CalculateOnBarClose: False
      Historical: [B][COLOR=Red]False[/COLOR][/B]
      x: 1
      ************************************************************************
      Best Regards
      Poseidon_Sthlm
      Attached Files
      Last edited by poseidon_sthlm; 08-25-2011, 08:11 AM.

      Comment


        #4
        poseidon_sthlm, thanks the attachment and run down of the issue, we'll look to reproduce shortly here.
        BertrandNinjaTrader Customer Service

        Comment


          #5
          Can you try the below as indicator instantiation and then let me know if you still see the discrepancy?

          mySMACOBC = SMACOBC(Range(), period); // Instanciate indicator
          BertrandNinjaTrader Customer Service

          Comment


            #6
            Thanks for the prompt reply.

            I did notice that the instantiation with Range() instead of Range().Values[0] or Range().Value don't produce the issue with the Historical property. But the provided indicators were only a very simplified example. I would prefer to be able to reference a DataSeries output (that's not a plot and thus not a member of the Values collection) to avoid infite DataSeries. And if I expose more than one single DataSeries from an indicator, I will only be able to pass the first DataSeries to the callee. Therefore the alternative instantiation doesn't feel as an attractive solution. Any other idea how to work around this?

            How can it be that the different instantiations that refer to the exact same dataseries produce different results in this scenario?

            (I have attached an revised version of my indicators if you would like to do some more tests. I have modified the properties of the output Value of the SMACOBC varaible to prevent possible update issues.)
            Attached Files
            Last edited by poseidon_sthlm; 08-25-2011, 12:41 PM.

            Comment


              #7
              Thanks for the confirmation and continued testing poseidon_sthlm - I will check with our developers here as to why this might be the case.
              BertrandNinjaTrader Customer Service

              Comment


                #8
                Thanks. I look forward to hear what your development department has to say.

                Best Regards
                poseidon_sthlm

                Comment


                  #9
                  Just wanted to update you here that this has not slipped our attention Poseidon_Sthlm, as a team member is attending a trading conference it might take a bit longer than usual for the investigation to be continued.

                  Thanks for the patience,
                  BertrandNinjaTrader Customer Service

                  Comment


                    #10
                    Thanks for the update.

                    Comment


                      #11
                      Any news on this subject?

                      // Regards,
                      poseidon_sthlm

                      Comment


                        #12
                        Unfortunately not poseidon_sthlm, I have asked for an update - thanks for the patience.
                        BertrandNinjaTrader Customer Service

                        Comment


                          #13
                          poseidon_sthlm, thanks again for the patience here - development looked into and this is unfortunately a current limitation, please stick to the working version using non .Values here for now.
                          BertrandNinjaTrader Customer Service

                          Comment

                          Latest Posts

                          Collapse

                          Topics Statistics Last Post
                          Started by bortz, 11-06-2023, 08:04 AM
                          47 responses
                          1,602 views
                          0 likes
                          Last Post aligator  
                          Started by jaybedreamin, Today, 05:56 PM
                          0 responses
                          8 views
                          0 likes
                          Last Post jaybedreamin  
                          Started by DJ888, 04-16-2024, 06:09 PM
                          6 responses
                          18 views
                          0 likes
                          Last Post DJ888
                          by DJ888
                           
                          Started by Jon17, Today, 04:33 PM
                          0 responses
                          4 views
                          0 likes
                          Last Post Jon17
                          by Jon17
                           
                          Started by Javierw.ok, Today, 04:12 PM
                          0 responses
                          12 views
                          0 likes
                          Last Post Javierw.ok  
                          Working...
                          X