Rank: Advanced Member
Groups: Registered, Registered Users, Unverified Users Joined: 3/9/2007(UTC) Posts: 35
Thanks: 1 times
|
Hello,
I need to know the possibility, and thereby how to codify Oscillator based on a "Ratio" instead of "Closing price"
Stochastic Formula = (C - LLV(L,14))/(HHV(H,14) - LLV(L,14))
What i desire is = (Ratio - LLV(L,14))/(HHV(H,14) - LLV(L,14)),
Where ratio may be taken as (Silver price/Gold price). HHV & LLV is of the Ratio.
If its possible to construct, then can indicator be created where "ratio" is variable?... cos' what if i desire the ratio to be (Stock Price/Index) or some other ratio.. What can be done? Please help.
Best,
Nishant
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Unverified Users Joined: 3/9/2007(UTC) Posts: 35
Thanks: 1 times
|
I suppose this is what i require:
(Ratio - LLV(Ratio,14))/(HHV(Ratio,14) - LLV(Ratio,14))
|
|
|
|
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)
|
You can use the SECURITY() function to create the Ratio.
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Unverified Users Joined: 3/9/2007(UTC) Posts: 35
Thanks: 1 times
|
Thank you Johnathan! That certainly did help me in progressing.
But i continue to encounter one more problem. I'm wondering if there is a short cut to it.
What i have done is created an indicator "ratio" by using the function Security("E:\Commodities\Metals\COPPER",C)/Security("E:\Commodities\Metals\GOLD",C)... and then developed the "Stochastic Ratio" by using the FML function that calls "ratio"... and the entire indicator is working perfectly. But the problem is that indicator being created certainly cant be applied to other metals with Gold being the base security.
Is there any methodology that can be applied in codification of "ratio" where 1st security (e.g. copper, lead, etc) can be made variable, and by dragging the indicator on any given chart it accepts and plots?.
|
|
|
|
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)
|
Take out the first SECURITY() function only -- just use C. It will then use the close of the current chart's symbol.
|
|
|
|
Rank: Advanced Member
Groups: Moderators, Registered, Registered Users, Subscribers Joined: 10/8/2010(UTC) Posts: 1,960
Thanks: 92 times Was thanked: 155 time(s) in 150 post(s)
|
here is a formula to plot the Stochastic Oscillator on any value you can calculate. The periods of the stochastic are set as variables and then the variable plot is the value the stochastic is to be plotted on:
k:=5; ks:=3; plot:=OscP( 5, 34, E, $ ); mod1:= If(LastValue(Lowest(plot))<0,LastValue(Abs(Lowest(plot))),0); p1:=plot+mod1; temp:=If(Sum( HHV(p1,k) - LLV(p1,k), ks)=0, 0.0001, Sum( HHV(p1,k) - LLV(p1,k), ks)); csto:=( Sum( p1 - LLV( p1, k), ks ) / temp) * 100; c[censored]>
You can use the Security function to make any ratio you wish and assign it to plot.
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Unverified Users Joined: 3/9/2007(UTC) Posts: 35
Thanks: 1 times
|
made myself look like a moron cos' am wondering why i couldn't figure out this simple equation... thanks a lot for all help Johnathan.. its working the way i desired... i love you.. :P
@MS Support: thanks for help :)
|
|
|
|
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.