Announcement

Collapse
No announcement yet.

Percentage Volume Oscillator

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

  • Percentage Volume Oscillator

    Does anyone know where I could find a post that has the EFS for the indicator 'Percentage Volume Oscillator'? It's a MACD applied to volume

    Thanks, Steven

  • #2
    Steven
    As far as I can tell the Percentage Volume Oscillator is constructed with the following equation using Volume as the data source for the exponential averages
    ((fastEMA-slowEMA)/fastEMA)*100
    This is the same equation used for the builtin Oscillator whereas in the MACD the oscillator is just the difference between the fastEMA and the slowEMA.
    To program the PVO first declare two global variables called for example PVO and SIG and set them initially to null;
    PHP Code:
    var PVO null;
    var 
    SIG null
    Then in main initialize the studies as in the following example
    PHP Code:
    if(PVO==nullPVO osc(1226truevolume());//parameters are fast_length, slow_length, exponential, source
    if(SIG==nullSIG ema(9PVO);//PVO is the source for the ema function 
    At this point you have all the elements to plot your oscillator, signal line and histogram (ie the difference bwteen the oscillator and signal line) which you can use to your return statement
    PHP Code:
    return new Array (PVO.getValue(0), SIG.getValue(0), (PVO.getValue(0)-SIG.getValue(0))); 
    All you need to add is the required statements in preMain to name the Cursor Window labels, set the plot types, colors, etc. If you then want to make the parameters user definable you will also need to add the corresponding FunctionParameters. As an example use those in the customMACD.efs which is in the EFS Custom folder
    In the image enclosed below you can see the result.
    Alex

    Comment

    Working...
    X