# NEOTICKER DATA BEGIN
ScriptType=Indicator
Description=Percentage Price Oscillator
Name=ppo
Language=VBScript
Links=1
MinBars=27
TimerInterval=100
EarlyBinding=0
MetaStyle=Normal
ValueRange=Same as Source
Placement=New Pane
Multiplot_num_plots=1
Multiplot_color_0=255
Multiplot_style_0=Line
Multiplot_width_0=1
Multiplot_enabled_0=1
Multiplot_breakstyle_0=0
UpdateByTick=1
FloatMarker=1
DepthData=0
TradingSystemUI=0
PrimaryLinkOnly=0
NotifyOnRemoval=0
Param_count=2
Param_name_0=Period 1
Param_inuse_0=1
Param_type_0=integer.gte.0
Param_default_0=12
Param_name_1=Period 2
Param_inuse_1=1
Param_type_1=integer.gte.0
Param_default_1=26
Explanation_Lines=0
# NEOTICKER DATA END

'NeoTicker Additional Indicator
'written by Kenneth Yuen, May 2001
'Copyright by TickQuest Inc.
'All right reserved

'Percentage Price Oscillator
'Stock & Commodities Magzine. February, 2001
'Revised by Kenneth Yuen, May 2008

Function ppo ()
  dim SmallEMA, LargeEMA

  if not data1.valid (0) then
     itself.success = false
     exit function
  end if

  SmallEMA = ItSelf.MakeIndicator("EMA1", "xaverage", _
                                Array("1"), Array(param1.str))
  LargeEMA = ItSelf.MakeIndicator("EMA2", "xaverage", _
                                Array("1"), Array(param2.str))

  if (Data1.BarsNum(0) > Param2.int) and (SmallEMA.value(0) <> 0) then
     ppo = (SmallEMA.value(0) - LargeEMA.value(0))/SmallEMA.value(0)*100
  else
     ItSelf.Success = false
  end if
End Function
