Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Indicator in an Indicator

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

    Indicator in an Indicator

    If I have an indicator that I have created for visual purposes say not a price overlay, but I need the data I am recording in the plot, is there any special way to pull that indicator into a different indicator that I want to be a price overlay for calculation purposes? I know we are just dealing with classes here, but its not clear to me how to instantiate it and how to make sure it gets the same onBarUpdate calls as the indicator its going into. If there is a reference on this I am happy to read it, I searched and could not find anything. Thanks

    #2
    Hello ErikY,

    There would not be anything special needed here, when calling an indicator from another indicator it would not be visual and would just be to retrieve the value. You would call your indicator in the same way that you would a system indicator. For example the bollinger has a Plot and it is called like this:
    Code:
    double upperValue = Bollinger(2, 20).Upper[0];
    That would be done from OnBarUpdate where you wanted to use the indicator.

    I look forward to being of further assistance.

    Comment


      #3
      I see, so no need to initialize it or anything, just call the indicator. I will play around with it, thanks.

      Comment


        #4
        Hello ErikY,

        Right, Indicators specifically have an internal cache system so you never actually need to use the "new" keyword to create them. That's the code that gets added at the bottom of the indicator file for reference here. This is different from normal C# programming where you would have to use the new keyword to create an object.


        I look forward to being of further assistance.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        683 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        386 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        111 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        584 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        585 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X