Discussions
»
Product and Service Development
»
Formula Assistance
»
Entry & exit point using positive volume index & RSI
Rank: Member
Groups: Registered, Registered Users, Subscribers Joined: 4/3/2009(UTC) Posts: 12
|
Dear Guys,
I'm new on Metastock. I wanna make entry & exit program explorer which combining Positive volume index (PVI) & RSI.
Entry strategy:
PVI (Day -2) > PVI (Day -1) and PVI (Day -1) <= PVI (Today) or PVI (Day -1) < PVI (Today), and RSI (Day -1) < RSI (Today)
Exit strategy:
PVI (Day -2) < PVI (Day -1) and PVI (Day -1) > PVI (Today), and RSI (Day -1) >= RSI (Today)
Thanks for help
Empu
|
|
|
|
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)
|
Hi Empu,
Welcome to the forum.
Please have a read through the MS Users Manual and then do the exercises in the free Equis Formula Primer (see the files section of the forum to download). Armed with this knowledge you should be able to write these codes for yourself.
As always, if you get stuck writing the codes, post them here and someone will assist you to fix the problems.
wabbit [:D]
|
|
|
|
Rank: Member
Groups: Registered, Registered Users, Subscribers Joined: 4/3/2009(UTC) Posts: 12
|
Dear Wabbit,
I try to find entry signal with this formula:
If( PVI(C,-3)>=,PVI(C)-2 <= PVI(C) AND RSI(14) < 40,1,0)
Looks like is fail because i couldn't figure out how to describing last today, yesterday and today
|
|
|
|
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)
|
|
|
|
|
Rank: Member
Groups: Registered, Registered Users, Subscribers Joined: 4/3/2009(UTC) Posts: 12
|
Wabbit,
Here the latest formula that I wrote:
PVI(Ref(C,-2))>=PVI(Ref(C,-1)) AND PVI(Ref(C,-1))<=PVI(C) AND RSI(14)<40 AND V>Ref(V,-1)
Seems like something wrong to me, cause to many buy signal. Could you give me suggestion? One more question: how to add some arrow on buy signal and sell signal.
Thanks
|
|
|
|
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)
|
I guess the first thing to notice is the difference between:
Ref(PVI(C),-2)
and
PVI(Ref(C,-2))
Which one are you looking for in your code?
The next thing to notice is that every time the condition specified is evaluated as TRUE, the indicator will return a value of 1. Depending on how you intend to use the indicator, you might consider only returning the first value in a succession of values, something like:
myEntryCriteria:= {expression goes here}; signals:=myEntryCriteria and alert(myEntryCriteria=0,2); {plot} signals;
Alternatively, if you also have a reset or exit condition defined, you can use one of the many latching systems, e.g.
buy:={expression goes here};
sell:={expression goes here};
init:=cum(isdefined(buy+sell))=1; trade:=barssince(buy+init) < barssince(sell+init); {plot} trade;
For more examples on using MSFL latches search for Roy Larsen's excellent article from the files section, or use the latching function in the free forum.dll also available in the files section.
Hope this helps.
wabbit [:D]
|
|
|
|
Users browsing this topic |
Guest (Hidden)
|
Discussions
»
Product and Service Development
»
Formula Assistance
»
Entry & exit point using positive volume index & RSI
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.