Announcement

Collapse
No announcement yet.

Bollinger Bands BandWidth - with last 100 periods Max & Min Value Lines

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

  • Bollinger Bands BandWidth - with last 100 periods Max & Min Value Lines

    Hi All,

    We all know the Bollinger Bands BandWidth Study.

    I would like to modify this Study in a way to display a 3 lines study instead of the current 1 line study.

    It will be done as it follows :

    The first line will remain the Bollinger Bands BandWidth Study = line 1 (in blue).

    The second line will be the Maximum Value that the Bollinger Bands BandWidth Study (line 1) reached during the last 100 periods = line 2 (in red).

    The third line will be the Minimum Value the Bollinger Bands BandWidth Study (line 1) reached during the last 100 periods = line 3 (in black).


    Interest in this study ?

    If line 1 is near or equal to line 2, we are at the maximum volatility and we are certainly near a top or a bottom.

    If line 1 is near or equal to line 3, we are at the minimum volatilitty (consolidation/congestion) and we are certainly near a breakout or breakdown.

    I have found the ''Math Methods'' available in eSignal but I don't know how to program this.

    max(value1, value2)
    returns the maximum value of value1 and value2

    min(value1, value2)
    returns the minimum value of value1 and value2

    Help needed ?

    Thank you.

    Olivier

    Attached : Bollinger Bands BandWidth .efs file
    Attached Files

  • #2
    Olivier
    The easiest way to accomplish what you are trying to do is to use the efsExternal() function which will create a series of the efs you are calling. This series can then be used as the source for the built-in studies.
    For the description of the efsExternal() function and the required syntax see this article in the EFS KnowledgeBase. Further information together with some examples can be found in this thread.
    In your case you would create a new efs and in main you would first call the Bandwidth.efs in the following way

    PHP Code:
    var Bandwidth efsExternal("/Bollinger/Bandwidth.efs");//this assumes that the called efs is in the Bollinger folder 
    At this point you have created the series which you can now use as the source for the upperDonchian() and lowerDonchian() builtin studies which will compute the highest/lowest value of the series.

    PHP Code:
    var HHBandwidth upperDonchian(100,Bandwidth);
    var 
    LLBandwidth lowerDonchian(100,Bandwidth); 
    Once you have done that you can use the variables HHBandwidth, Bandwidth and LLBandwidth in your return statement which will plot them on the chart.
    All that is left to do is to add the preMain() function with the required statements to set the plot types, color, the plots, name the Cursor Window labels, etc. You can use as a reference the template efs which is available in this thread.
    Alex

    Comment


    • #3
      Help needed ?

      Hi Alexis,

      Seen all your recommended posts on the externalfunction but ...

      bad programmer as I am, after 2 hours trying, still errors in the formula.

      Could you chack it ?

      Olivier

      efs file attached


      All Studies are in the folder called "My Indicators and Studies"

      BBBWMAM = Bollinger Bands BandWidth With Max And Min.

      The Bollinger Bands Bandwidth study is also in the same folder under the name BBBW.efs
      Attached Files

      Comment


      • #4
        Olivier
        In lines 33 and 34 you are not using the appropriate source for the Donchian studies. The source should be Bandwidth which is the series being created with the efsInternal() function and not BBBW which is the efs being called by that function (see the example in my prior reply)
        Also you are declaring the variables Bandwidth, HHBandwidth and LLBandwidth as local variables so you don't need to declare them in lines 26-28
        The other error is in line 39 (ie just above the return statement) where you have a redundant closing bracket }
        Alex

        Comment


        • #5
          Thank you Alexis

          Thank you very much Alexis.

          It works.

          Olivier

          Comment

          Working...
          X