Rank: Member
Groups: Registered, Registered Users Joined: 9/25/2005(UTC) Posts: 22
|
Hi Stockman,
I try to make an indicator for the VIX-index. When the closing price of the VIX drops more then 5% from its Simple moving average or rises more then 5% above its Simple moving average then give a signal (plot a 1). I've made the following formulae:
((C-Mov(C,10,S))/Mov(C,10,S))*100<-5 OR ((Mov(C,10,S)-C)/Mov(C,10,S))*100>5
But this formulae didn't get the wright signals! Do you know what's wrong with it or do you have/know the correct formulae to get the wright signals?
Thanks,
Hung
g_stockman wrote:Check this out: http://forum.equis.com/viewtopic.php?t=3458
Since we changed topics, please use the new thread above... sorry, there isn't a feature to join posts, so I just copied them with over. If you want to re-enter the original message, I'll gladly delete my copy.
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers, Unverified Users Joined: 10/28/2004(UTC) Posts: 3,111 Location: Perth, Western Australia
Was thanked: 16 time(s) in 16 post(s)
|
Hung....
The problem with your code is because it contain fundamentally flawed logic...
Quote:((C-Mov(C,10,S))/Mov(C,10,S))*100<-5 OR ((Mov(C,10,S)-C)/Mov(C,10,S))*100>5
In the first half of the formula you have:
(C-Mov(C,10,S)
whereas in the second half you have:
(Mov(C,10,S)-C)
THESE ARE NOT THE SAME!
If you want to compare apples with apples, then compare only like types:
x:=C-Mov(C,10,S);
Abs(x/Mov(C,10,S))*100<5
Hope this helps.
wabbit :D
P.S. You have been asked to start a NEW thread when asking NEW questons, please abide by these requests.
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers Joined: 10/12/2005(UTC) Posts: 141 Location: Brooklyn,NY
|
Hi Antjinsan,
I was working on a few things over the weekend and that was one of them that I created for the vix.
Here is what I got; I made them into separate indicators.
{5%>10ma}Name
{x:=Mov(C,10,S); This is your 10ma
H>=X*(1.05);} This is your 5% above 10ma
{5%<10ma}Name
{x:=Mov(C,10,S);This is your 10ma
L<=X*.95} This is your 5% below 10ma
Just make sure you remove the brakets...I put them here to avoid smiley faces.
|
|
|
|
Rank: Member
Groups: Registered, Registered Users Joined: 9/25/2005(UTC) Posts: 22
|
Hi Sportrider and Wabbit,
Thank you both for your quick reply and help!
I will try both indicators but Sportrider's formulae looks good. Maybe a stupid question but, can I also leave out the ''Name'' at :{5%<10ma}Name?
How can I put in a New question instead of a New Thread cause probably I use the wrong option?
Thanks again for your help!
Cheers,
Hung alias antjinsan!
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users Joined: 3/19/2005(UTC) Posts: 2,995
Was thanked: 14 time(s) in 10 post(s)
|
Hey Antjinsan-
This is SR's method without the comments...
[code:1:3845425e23]x:=Mov(C,10,S);
up:=H>=X*1.05;
dn:=L<=X*0.95;
up;dn[/code:1:3845425e23]
Wabbit's Apples code is pretty sleek too... don't discount it.
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers Joined: 10/12/2005(UTC) Posts: 141 Location: Brooklyn,NY
|
Hey g_stockman,
Thanks for the new way,I had two separate now I could have them both in one indicator,instead of two separate.I would change the up;dn to up-dn that way you get -1 for dn and +1 for up.
|
|
|
|
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.