Rank: Member
Groups: Registered, Registered Users, Unverified Users Joined: 6/12/2012(UTC) Posts: 19 Location: South Africa - JHB
|
Hi
I wonder if someone could explain to me how I can create a histogram with the below indicator?
Basically I am wanting everything coloured in that which is below 0 up to Closing line and above 0 up to Closing line. I just want everything shaded in.
Not sure if I am making sense. Very new to coding and have really no clue what I am doing.
{Relative Strength Code}
x:= Security("C:\EQUIS\INDEX\J203",C);
y:= Input("Periods for Ratio",0,9999,1);
z:= Input("Periods to Sum up", 1,9999,52);
R:= C/x;
base:= Sum(R,z)/z;
mf:= ((Ref(R,-y)/base)-1)*10;
mf;0;
|
|
|
|
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)
|
RUTrading wrote:I wonder if someone could explain to me how I can create a histogram with the below indicator? You want something like this: 1. You need to change the last line so that it has TWO (2) plots -- one for above zero, a separate plot below zero. Change the last line of your code, as follows: OLD
NEW
Code:
If(mf>0,MF,0); { GREEN }
If(mf<0,MF,0); { RED }
2. Then, change each plot STYLE to "HISTOGRAM" and COLOR to what you want. NOTE: You need to click one of these, make the style & color changes, then click an empty spot on the chart, then click the other line. In MetaStock, there is no way to do this in the formula code.
|
|
|
|
Rank: Member
Groups: Registered, Registered Users, Unverified Users Joined: 6/12/2012(UTC) Posts: 19 Location: South Africa - JHB
|
Thanks Johnathan.
I have done what you said below, which is almost there, but I would like those lines in the histogram to be a solid colour and not individual lines.
Is this possible?
|
|
|
|
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)
|
The best you can do is to "thicken" the plot style to maximum; then, when you shrink the x-axis to about a year (or more), it will "appear" to be solid.
|
|
|
|
Rank: Member
Groups: Registered, Registered Users, Unverified Users Joined: 6/12/2012(UTC) Posts: 19 Location: South Africa - JHB
|
|
|
|
|
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.