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 argusthome, Yesterday, 10:06 AM
        0 responses
        14 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        11 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        9 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        4 views
        0 likes
        Last Post TheRealMorford  
        Started by Mindset, 02-28-2026, 06:16 AM
        0 responses
        31 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Working...
        X