# NEOTICKER DATA BEGIN ScriptType=Indicator Description=Relative Price Name=RelativePrice Language=Formula Links=2 MinBars=0 TimerInterval=100 EarlyBinding=0 MetaStyle=Candle ValueRange=Same as Source Placement=Smart Multiplot_num_plots=4 Multiplot_color_0=255 Multiplot_style_0=Line Multiplot_width_0=1 Multiplot_enabled_0=1 Multiplot_breakstyle_0=0 Multiplot_color_1=255 Multiplot_style_1=Line Multiplot_width_1=1 Multiplot_enabled_1=1 Multiplot_breakstyle_1=0 Multiplot_color_2=255 Multiplot_style_2=Line Multiplot_width_2=1 Multiplot_enabled_2=1 Multiplot_breakstyle_2=0 Multiplot_color_3=255 Multiplot_style_3=Line Multiplot_width_3=1 Multiplot_enabled_3=1 Multiplot_breakstyle_3=0 UpdateByTick=1 FloatMarker=1 DepthData=0 TradingSystemUI=0 PrimaryLinkOnly=0 NotifyOnRemoval=0 Param_count=3 Param_name_0=Scale Param_inuse_0=1 Param_type_0=formula Param_default_0=data2|(data2.h + data2.l + data2.c) / 3|average (data2, 20) Param_name_1=Start Date Param_inuse_1=1 Param_type_1=date Param_default_1=1900/1/1 Param_name_2=Style Param_inuse_2=1 Param_type_2=string Param_default_2=Percent Change|Ratio Explanation_Lines=1 Explanation0=Data1 is rescaled using data2 as the reference value. More complex rescaling can be done using the Scale parameter with custom formula. Start Date set the reference value for rescaling. # NEOTICKER DATA END ' Relative Price ' Written by Lawrence Chan ' Copyright © 2009 by TickQuest Inc. ' All rights reserved ' scale is the reference series for valuation makeindicator (scale, fml2, data1, data2, param1); ' indicator start its calculation when start date is reached $init := if ($init = 0 and date (0) >= param2, scale, $init); success1 := $init <> 0; success2 := $init <> 0; success3 := $init <> 0; success4 := $init <> 0; ' rescale data1 based on ' Percent Change - the ratio of current vs initial valuation ' Ratio - the ratio between data1 and scale $pbase := if (scale = 0, 1, scale); $rbase := if ($init = 0, 1, $init); $factor := choose ( $init = 0 or scale = 0, 0, paramis (3, "Ratio"), 1 / $pbase, scale / $rbase); plot1 := open * $factor; plot2 := high * $factor; plot3 := low * $factor; plot4 := close * $factor;