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

Re: [EquisMetaStock Group] Help with creating 2 Momentum Indicators



PureBytes Links

Trading Reference Links

... And the 3/9 Price Oscillator is also exactly the same as a 3/9 
MACD.  I wonder which came along first.

====
MACD
====
---8<--------------------

{ MACD & Histogram }
{ http://www.metastocktools.com }

{ User inputs }
shortPds:=Input("shorter MACD periods",
 1,260,3);
longPds:=Input("longer MACD periods",2,2600,9);
triggerPds:=Input("MACD signal periods",
 1,260,16);
plot:=Input("plot:  [1]MACD,  [2]Histogram",
 1,2,1);

{ MACD }
Mac:=Mov(C,shortPds,E)-Mov(C,longPds,E);

{ Signal }
Signal:=Mov(Mac,triggerPds,E);

{ Histogram }
Hist:=Mac-Signal;

{ Plot in own window }
0;If(plot=1,Signal,Hist);
If(plot=1,Mac,Hist)

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


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



--- In equismetastock@xxxxxxxxxxxxxxx, "Tim" <prez@xxxx> wrote:
>
> Hi Cholrton,
>  
> The indictor that you are describing is called a Price Oscillator
> and is available stock standard in Metastock.
> The only thing you can't do with it is apply a moving average to the 
> Price Oscillator indicator output, that is unless you create your
> own custom indicator.
> Below is some code that will allow you to achieve this.
>  
> Pd1:=Input("Short MA Period",1,50,3);
> Pd2:=Input("Long MA Period",5,100,9);
> Pd3:=Input("Oscillator MA Period",5,100,16);
> Osc:=OscP(Pd1,Pd2,E,$);
> OMA:=Mov(Osc,PD3,E);
> Osc;OMA;
>  
> Regards,
> Tim Hyder
> -------------------------------------------------------
> A successful man is one who can build a firm
> foundation with the bricks that others throw at him.
>  
> David Brinkley
> -------------------------------------------------------
>   _____  
> 
> From: equismetastock@xxxxxxxxxxxxxxx [mailto:
> equismetastock@xxxxxxxxxxxxxxx]
> On Behalf Of chorlton_c_hardy
> Sent: Friday, 14 October 2005 02:47
> To: equismetastock@xxxxxxxxxxxxxxx
> Subject:
> [EquisMetaStock Group] Help with creating 2 Momentum Indicators
>  
> Hi All,
> 
> Can anyone help me !!!
> 
> I want to create a new oscillator in Metastock, which will contain 2 
> lines as momentum indicators and would welcome any help regarding 
> creating these.
> 
> The basic idea is that I want to plot a line, which is the result of 
> one Moving Average deducted from another Moving Average and plot the 
> net result (either a positive or negative number) as a line on the 
> chart. 
> 
> The formula for the 1st line on the Oscillator should be:
> 
> 3 day MA of closing price minus 9 day MA of closing price
> 
> (if this is working properly then hopefully the line should rise 
> above the horizontal 0, if the price over the last few days has been 
> moving up faster than the price for the last couple of weeks & 
> obviously below it if it hasn't)
> 
> 
> The 2nd line on the Oscillator should be:
> 
> 16 day MA of the 1st Oscillator line (which has just been plotted)
> 
> 
> Can anyone help me in putting this all together :-/  as my current 
> knowledge of Metastock is limited.
> 
> 
> Many Thanks in advance,
> 
> Chorlton






------------------------ Yahoo! Groups Sponsor --------------------~--> 
Try Online Currency Trading with GFT. Free 50K Demo. Trade 
24 Hours. Commission-Free. 
http://us.click.yahoo.com/RvFikB/9M2KAA/U1CZAA/BefplB/TM
--------------------------------------------------------------------~-> 

 
Yahoo! Groups Links

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

<*> 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/