Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Template for Formula Based Indicator with Average

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

    Template for Formula Based Indicator with Average

    Hi,


    I am having a issue building a formula based indicator. Since this is a issue I am sure many people have and will keep having I will make it very generic so everyone can use it.


    The question is: Can someone build a WORKING formula of the following math with a length attached to it that can be changed.


    The Average True Range Indicator is a good example. High – Low formula with a average and the example of how the math is written so anyone can copy and paste it to change whatever is needed.

    The formula: ((H-L) + (H[1]-L[1])) /2

    This formula (or any other formula that would make a good example) with a changeable moving average so that it can be made longer or shorter.


    Thanks,

    #2
    Hello DZ954,

    Thank you for your post.

    I do not understand the concept of adding a Length to the formula, can you expand on this idea?

    Comment


      #3
      Let’s say I wanted to plot the average price with an input for the formula below (or any formula that includes math and bar references). How would this be done?


      (High[0] + High[1] /2) +Open[0];


      The other question/issue is I did get a formula like this to work on the current bar but after I loaded the chart once it won’t show after that. What can that be?



      The end result needed is to have a template that anyone can just put in the math formula and then test lengths of that formula.

      Comment


        #4
        Originally posted by DZ954 View Post
        Hi,


        I am having a issue building a formula based indicator. Since this is a issue I am sure many people have and will keep having I will make it very generic so everyone can use it.


        The question is: Can someone build a WORKING formula of the following math with a length attached to it that can be changed.


        The Average True Range Indicator is a good example. High – Low formula with a average and the example of how the math is written so anyone can copy and paste it to change whatever is needed.

        The formula: ((H-L) + (H[1]-L[1])) /2

        This formula (or any other formula that would make a good example) with a changeable moving average so that it can be made longer or shorter.


        Thanks,

        There is nothing to code. What you look for is a simple moving average of the range. Just open a chart, add a SMA with a period of 2 and then select the range indicator as input series.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        576 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        334 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        101 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        553 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        551 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X