logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
theghost  
#1 Posted : Friday, October 7, 2011 3:41:59 PM(UTC)
theghost

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 5/4/2005(UTC)
Posts: 63
Location: Poole Dorset England

Hello All.
I was wondering if anybody can help me.
I was looking to plot the Price OSC (In Metastock 10 Pro) in a inner window and at the same time overlay a PSAR that is dual coloured.
So really the Price OSC is the Indicator but the PSAR will be a colour study overlayed on the Price OSC.

I have a formula for a dual coloured PSAR, but this only works when plotted on a price chart and not on another indicator. (Green for Bullish & Red for Bearish)
Formula is (For reference)
Code:

A:=Input("Step value", 0.001,1,0.018);
B:=Input("Maximum value",0.01,1,0.2);
R:=SAR(A,B);
If(R<C,R,0);
If(R>C,R,0); 
{0;}
ValueWhen(1,0=1,0);

The above code still needs to be styled and coloured within its properties window.
Does anybody know how to do this? Or,, has anybody tried this?

It would be very useful.
I hope somebody can help me here with this.
Many thanks
Theghost. :-)
jjstein  
#2 Posted : Friday, October 7, 2011 8:18:51 PM(UTC)
jjstein

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 5/13/2005(UTC)
Posts: 715
Location: Midwest, USA

Was thanked: 1 time(s) in 1 post(s)
When an indicator plots multiple values, you select each separately, and set properties from the toolbar -- or double-click and use a dialog box. You MAY have to click on an empty area of the chart, before selecting another set of values to change.

Personally, it's better to NOT plot indicator-on-indicator -- it's easier to just rewrite as an all-in-one.

Unfortunately, the code you posted seems garbled, so I'm not sure what you're trying to do, exactly; you should be able to convert the PSAR to an independent indicator, rather than having to overlay it -- just put in the formula for Price OSC, which should be in the manual, online formula library, or a quick search should turn it up.

theghost  
#3 Posted : Saturday, October 8, 2011 4:55:26 AM(UTC)
theghost

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 5/4/2005(UTC)
Posts: 63
Location: Poole Dorset England

Many thanks jjstein for your reply.

Sorry,, in re-reading my original post, it seems to be,, well, not clear in exactly what I'm really wanting to do,, so I'll explain hopefully a bit better now.

1. I really am looking to display the Metastock PriceOSC (Which must be displayed as a HISTOGRAM) in a inner window.
2. Overlay a (DUAL) coloured PSAR on top of this.
3. So,, the individual bars of the price OSC will be coloured Red or Green depending (ONLY) on the PSAR value,,, (NOT) if the PriceOSC is above or below the 0 line.

So all the PriceOSC bars that are green are only green because the PSAR is below price (Trailing stop so to speak) and all the PriceOSC bars that are red are only Red because of the PSAR plot,, ie, PSAR is above price bars).

I hope this clarifies things a bit jjstein.
Thing is,,,, I really don't know how the write this code.
If anybody can help it would be most helpful.
I'm sure this would be a valuable indicator for Metastock users.

Many thanks
The Ghost
jjstein  
#4 Posted : Saturday, October 8, 2011 6:07:24 PM(UTC)
jjstein

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 5/13/2005(UTC)
Posts: 715
Location: Midwest, USA

Was thanked: 1 time(s) in 1 post(s)
>>2. Overlay a (DUAL) coloured PSAR on top of this.

If you are trying to use the PSAR on an indicator, you may be out of luck. I think this is dependent on the CLOSE, and if memory serves, can NOT be written in the Metastock Formula Language; it would have to be DLL.

OTOH, if you merely want to combine the status of PSAR with the PriceOsc, that should be doable. Here is the formula, from the Metastock Help file:

{ _PSAR -- your formula, at least what I could make of it }
A:=Input("Step value", 0.001,1,0.018);
B:=Input("Maximum value",0.01,1,0.2);
R:=SAR(A,B);
If(R<C,R,0);
If(R>C,R,0);


{ _PriceOsc -- from Metastock Help }
M1:=Input("MA 1",1,500,10);
M2:=Input("MA 2",1,500,20);
PriceOsc:=(( Mov(C,M1,E) - Mov(C,M2,E) )/Mov(C,M2,E)) * 100;
PriceOsc;


{ _Price Oscillator and PSAR -- combined }
M1:=Input("MA 1",1,500,10);
M2:=Input("MA 2",1,500,20);
PriceOsc:=(( Mov(C,M1,E) - Mov(C,M2,E) )/Mov(C,M2,E)) * 100;

A:=Input("Step value", 0.001,1,0.018);
B:=Input("Maximum value",0.01,1,0.2);
R:=SAR(A,B);

If(R<C,PriceOsc,0); { Green for long }
If(R>C,PriceOsc,0); { Red for short }


FWIW, it might be helpful if you did a screen-capture (Alt-PrtScrn), paste it into Paint, maybe label things a bit, and upload with IMGUR.

Here are the above formulas, plotted on the SPX: UserPostedImage

theghost  
#5 Posted : Sunday, October 9, 2011 4:16:25 AM(UTC)
theghost

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 5/4/2005(UTC)
Posts: 63
Location: Poole Dorset England

Many Thanks Again jjstein,
Seems to be working fine!!

Never heard of the website (IMG upload site,, A good 1!!) :-)

I'll try and post the imare below now.
As a note, The Price OSC with PSAR can be used in various ways,
for divergences, (leading indicator) , for a simple confirmation buy/sell system,
IE, buy on green (when above signal line), sell on red (when below signal line).

In conjunction with BBand/MACD, 2 other indicators for confirmation and exit warnings.
The template is enough, no more needs to be added,,, a variance in types of indicators used;
(for robustness) IE, Volatility (BBand) Momentum(STOCH RSI), etc etc
UserPostedImage

Many thanks again
jjstein,
Great job! :-)
Best regards;
The Ghost
Users browsing this topic
Guest (Hidden)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.