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

Notification

Icon
Error

Options
Go to last post Go to first unread
JamesTulsa  
#1 Posted : Thursday, February 4, 2010 6:05:16 PM(UTC)
JamesTulsa

Rank: Newbie

Groups: Registered, Registered Users, Subscribers
Joined: 10/26/2005(UTC)
Posts: 3
Location: Tulsa, OK

I would appreciate someone’s assistance on creating a formula that would draw a line segment under price only when a certain condition exists. For example, a horizontal line segment drawn say 5% below the current price every time RSI() is less than 30. Thanks
johnl  
#2 Posted : Thursday, February 4, 2010 6:50:47 PM(UTC)
johnl

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 11/7/2005(UTC)
Posts: 602


You could try something like:

a1:=rsi(14)<30;
a2:=(0.95*L);
a3:=If((a1=1),a2,1.05*H);
a3

JamesTulsa  
#3 Posted : Thursday, February 4, 2010 7:02:11 PM(UTC)
JamesTulsa

Rank: Newbie

Groups: Registered, Registered Users, Subscribers
Joined: 10/26/2005(UTC)
Posts: 3
Location: Tulsa, OK

Thanks for your quick response. If I could show you a snapshot of my screen it might explain a little better what I'm looking for. How can I do that?
oztrader  
#4 Posted : Friday, February 5, 2010 4:00:03 AM(UTC)
oztrader

Rank: Advanced Member

Groups: Registered, Registered Users, Unverified Users
Joined: 7/12/2007(UTC)
Posts: 134
Location: Perth Western Australia

Hi James,

Your request, the solution to which may appear somewhat simple in some software packages, requires a work-around in MetaStock (firstly no line just a dot).

Hopefully I've covered all the steps required but please let me know if you have any problems.


Step 1) Create a new formula named "Low - 5%" using Copy&Paste to create the formula below:-

{Low - 5%}
LOW*0.95; {Style = Invisible}

Step 2) Create a second new formula named "RSI Test" using Copy&Paste to create the formula below:-

{RSI Test}
HiddenPart:=
If(RSI(C,14)<30,0,LOW*0.95);
{Plot}
LOW*0.95; {Colour=Red, Style=Dot, Weight=Heaviest}
HiddenPart; {Colour=White, Style=Dot, Weight=Heaviest}
ValueWhen(1,0,0); {Re-scaling solution as provided by Wabbit}

Step 3) Insert the 1st new formula in the chart window.

Step 4) Right click on the newly created indicator & change the Colour/Style Properties to Style=Invisible & press OK (Now I understand the new indicator has disappeared but this step may be useful at the end of the process - see ??).

Step 5) Insert the 2nd new formula in the chart window (N.B. This formula will create 2 lines in some areas, but that is what we want to happen).

Step 6) CAUTION - choosing a part of this indicator that is situated between 2 lines heading towards the bottom of the page, right click & change the Colour/Style Properties to Colour=Red, Style=Dot, Weight=Heaviest & press OK.

Step 7) CAUTION - choosing a part of this indicator that is heading towards the bottom of the page, right click & change the Colour/Style Properties to Colour=White, Style=Dot, Weight=Heaviest} & press OK (N.B. white has been chosen to match the background colour of the window & this colour must be selected accordingly).

?? Move your cursor over the dot to get the value of Low minus 5%.
If this vaue is not required then delete steps 1, 3 & 4.

Cheers,
oz

JamesTulsa  
#5 Posted : Friday, February 5, 2010 6:52:25 PM(UTC)
JamesTulsa

Rank: Newbie

Groups: Registered, Registered Users, Subscribers
Joined: 10/26/2005(UTC)
Posts: 3
Location: Tulsa, OK

Thanks Oz. Still not exactly what I was looking for though. Wanted a short horizontal line so it would look like a bit of support. Your approach does take care of the Y-scaling problem I had with the formula I had been using. Again thanks for your help. James
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.