• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Values of another indicator

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

    Values of another indicator

    I'm trying to call the values of another indicator (Opening Range),
    Code:
    double OpenRangeHigh    =  OpeningRange ("1700","0830","1515").RangeHighSeries[0];
    The Intellisense parameters are: ( string openTime, string rangeEndTime, string stopPlotTime )

    Print(OpenRangeHigh); is coming back as "0".

    But when I do a Print (RangeHighSeries[0]) directly from the Opening Range indicator, the output is the correct one.

    Is my syntax wrong as I called the values of the other indicator? Thanks in advance.

    #2
    Hello,

    Thank you for the question.

    Based on the syntax that looks like what the indicator is asking for.

    Is this a free indicator I could download to test this? Because this is not a stock item I cant really say what may be happening, if OpeningRange is an open source indicator we may be able to determine why.

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      I believe that the reason Print for my indicator is coming back as "0", is because Opening Range indicator is using values of another indicator and these values are not passed on to my final indicator.

      In other words, I have the following situation: Indicator "B (Opening Range)" is calculated by calling the values of indicator "A", so now I need my new indicator "C" to call on the values of the new indicator "B". Do the values of "A" not just "B" have to be passed on to "C"?

      What should be the syntax if this is the case? Thanks again.

      Comment


        #4
        Hello,

        Thank you for the clarification.

        I did a simple test of this and was able to confirm the scenario. What is happening is that the Update of the value is not getting passed down the chain due to the way the scripts work together.

        One way of resolving this is to force the script to Update its values when you try to get the value.

        To do this you would need to modify the scripts A and B so C will get the end value. If you do not have access to the source for A and B, this may prevent this chain from working correctly and you may need to re work the logic.

        What you can do is in the get part of the property you can add Update(); or like the following:

        Code:
        public bool GreaterAgain
        {
        	get {Update(); return greaterAgain; }
        	set { greaterAgain = value; }
        }
        This would need to be changed in A and B, then C should see the updates during OnBarUpdate.

        I look forward to being of further assistance.
        JesseNinjaTrader Customer Service

        Comment


          #5
          Jesse,
          I was able to get it to work. Thanks for the code and for the help.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Atilla, Today, 04:05 PM
          0 responses
          6 views
          0 likes
          Last Post Atilla
          by Atilla
           
          Started by Displacer, Today, 02:57 PM
          2 responses
          13 views
          0 likes
          Last Post Displacer  
          Started by SAILIKITY, 05-22-2019, 05:41 PM
          1 response
          8 views
          0 likes
          Last Post NinjaTrader_PaulH  
          Started by rmillar, 01-09-2019, 06:02 PM
          6 responses
          71 views
          1 like
          Last Post eDanny
          by eDanny
           
          Started by mlarocco, Today, 11:39 AM
          4 responses
          23 views
          0 likes
          Last Post mlarocco  
          Working...
          X