[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[EquisMetaStock Group] Re: Scaling



PureBytes Links

Trading Reference Links

Jim, you can normalize any price/indicator to a 0~100% bounded oscillator 
with the indicators below from
http://www.metastocktools.com/#metastock


MetaStock -> Tools -> Indicator Builder -> New
-> Copy and paste formulae below.

====================
Normalized Indicator
====================
---8<---------------------------

{ Normalizes indicator to 0~100% boundaries }
{ From: http://www.metastocktools.com }

{ User inputs }
plot:=Input("plot:  [1]Indicator,  [2]Oscillator",1,2,2);
pds:=Input("Indicator periods",1,2600,21);

{ Indicator - EMA example }
Ind:=Mov(C,pds,E);

{ Normalize indicator to historical highs/lows }
Oscillator:=(Ind-Lowest(Ind))
 /Max(Highest(Ind)-Lowest(Ind),.000001)*100;

{ Plot:
  Indicator on chart, oscillator in own window }
If(plot=1,Ind,Oscillator)

---8<---------------------------



I often get asked something along this line of thinking:
"My price chart is out of scale when I apply the MACD to it
 - how can I get MACD()/price crossover signals?"

Before we can apply any relative comparisons between a chart and
unscaled indicator, both plots need to be normalized to a common scale.

There are two easy ways to normalize plots to 0~100%:
 using historical High/Lows, or x periods' High/Low:


===============================
Normalization - Price/Indicator
===============================
---8<--------------------------

{ Normalizes two data array plots to within
   0~100% boundaries, and allows direct
   comparisons between the two plots. }

{©Copyright 2004 Jose Silva
  For personal use only.
  http://www.metastocktools.com }

{ Choose between normalizing lookback periods
   or historical High/Low normalization }
pds:=Input("Normalizing lookback periods (1= historical Hi/
Lo)",1,2600,126);


{ Plot 1: Price section }
PriceX:=C;

{ Choose x pds or historical Price High/Low }
Hi:=If(pds>1,HHV(PriceX,pds),Highest(PriceX));
Lo:=If(pds>1,LLV(PriceX,pds),Lowest(PriceX));

{ Price normalized to 0~100% }
PriceNorm:=(PriceX-Lo)/Max(Hi-Lo,.000001)*100;


{ Plot 2: Indicator/Oscillator section }
IndX:=MACD();

{ Choose x pds or historical Indicator High/Low}
Hi:=If(pds>1,HHV(IndX,pds),Highest(IndX));
Lo:=If(pds>1,LLV(IndX,pds),Lowest(IndX));

{ Indicator normalized to 0~100% }
IndicatorNorm:=(IndX-Lo)/Max(Hi-Lo,.000001)*100;


{ Plot in own window }
PriceNorm;IndicatorNorm

---8<--------------------------


jose '-)
http://www.metastocktools.com






--- In equismetastock@xxxxxxxxxxxxxxx, stinkerstock <no_reply@xxx> wrote:
>
> Hi folks:
> 
> Does anyone know of a way to set a scaling feature into a custom 
> indicator? 
> 
> For example, I've created an indicator that plots a moving average of 
> advancing and decling volume.  When I plot the indicator, it displays 
> what I want except the indicator is rather small in the window because 
> for some reason it is scaled improperly.  
> 
> I know I can change the scale manually by modifying the Y-axis 
> proerties or by using a mouse drag...but is there a way to build in 
> maximum-minimum values into the indicator itself so I don't have to 
> scew around with manual adjustments?
> 
> Thanks in advance.
> 
> Jim




------------------------ Yahoo! Groups Sponsor --------------------~--> 
Transfer from your equities account.  
Receive up to $1,000 from GFT. Click here to learn more.
http://us.click.yahoo.com/aZttyC/X_xQAA/cosFAA/BefplB/TM
--------------------------------------------------------------------~-> 

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/equismetastock/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/equismetastock/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:equismetastock-digest@xxxxxxxxxxxxxxx 
    mailto:equismetastock-fullfeatured@xxxxxxxxxxxxxxx

<*> To unsubscribe from this group, send an email to:
    equismetastock-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/