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

Notification

Icon
Error

Options
Go to last post Go to first unread
hbjerry  
#1 Posted : Thursday, September 29, 2005 6:28:20 PM(UTC)
hbjerry

Rank: Newbie

Groups: Registered, Registered Users, Subscribers
Joined: 9/29/2005(UTC)
Posts: 7

Rules= Always in the market. 3 min data bars,9 period weighted mov avg and a 11 period weighted mov avg shifted to the right +3 bars. When they cross over to the up side your long.and a crossover to the down side the position is short. No stops, YOU are either long or short on a crossover. hOW DO I WRITE THIS IN xml code or any code? Can't find anything on horizonal shift.
Patrick  
#2 Posted : Thursday, September 29, 2005 6:30:47 PM(UTC)
Patrick

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 9/8/2004(UTC)
Posts: 2,266

Was thanked: 1 time(s) in 1 post(s)
For an horizontal shift use the Reference function ... Try: Ref(Mov(c,11,W),3) or Ref(Mov(c,11,W),-3) Patrick :mrgreen:
henry1224  
#3 Posted : Thursday, September 29, 2005 11:11:24 PM(UTC)
henry1224

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 10/29/2004(UTC)
Posts: 1,394
Location: Glastonbury, CT

Was thanked: 2 time(s) in 2 post(s)
Any shift of the MA to the left, requires a forward ref function. It will then become 3 bars late, due to Metastock's need for those 3 bars of data. IE: today's data is Thursday , the ma needs data for Friday, Monday and Tuesday before it can show you signal. Since the 3 days have not traded, this system is moot you will need the Ref(Mov(C,5,S),-3); to shift the MA 3 bars to the Right
hbjerry  
#4 Posted : Friday, September 30, 2005 9:58:26 AM(UTC)
hbjerry

Rank: Newbie

Groups: Registered, Registered Users, Subscribers
Joined: 9/29/2005(UTC)
Posts: 7

SO where can i get this idea converted to a formula and then to c++?
Jose  
#5 Posted : Friday, September 30, 2005 11:32:02 AM(UTC)
Jose

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 1/19/2005(UTC)
Posts: 1,065
Location: Koh Pha-Ngan, Earth

Was thanked: 2 time(s) in 2 post(s)
Hbjerry, it's obvious what you're up to, and you are wasting your time here. This is a MetaStock community, and not a black box developers forum. jose '-)
hbjerry  
#6 Posted : Saturday, October 1, 2005 1:55:38 AM(UTC)
hbjerry

Rank: Newbie

Groups: Registered, Registered Users, Subscribers
Joined: 9/29/2005(UTC)
Posts: 7

From the mouth of babes leads to true wisdom. BUT you can be better than that.EXpand your horizons and lend a littel help.
StorkBite  
#7 Posted : Saturday, October 1, 2005 8:02:17 AM(UTC)
StorkBite

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 3/19/2005(UTC)
Posts: 2,995

Was thanked: 14 time(s) in 10 post(s)
Quote:
EXpand your horizons and lend a littel help.
Hey hbjerry- You've gotten some great help here already. What have you done to help yourself? If you're stuck writing your code, then post what you have and explain what's not working.
hbjerry  
#8 Posted : Saturday, November 5, 2005 6:52:00 PM(UTC)
hbjerry

Rank: Newbie

Groups: Registered, Registered Users, Subscribers
Joined: 9/29/2005(UTC)
Posts: 7

I watched all the videos,looked at all the sample code and came up with. bullish Cross(Mov(C,9,W),Ref( (Mov(C,13,W)),3)) bearish Cross(C,Ref( (Mov(C,13,W)),3))AND (Mov(C,9,W)) added the ribbon too.But I get so many false signals as price stays above average, ribbon should stay green but turns red when there has been no cross in price. Where did I go wrong?
Patrick  
#9 Posted : Sunday, November 6, 2005 12:15:41 AM(UTC)
Patrick

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 9/8/2004(UTC)
Posts: 2,266

Was thanked: 1 time(s) in 1 post(s)
Hi HbJerry, Thanks for doing your homework ;) By looking at your formula I can point that the problem is with the ref function ... It is looking forward ... [code:1:a19911fd6c]Ref( (Mov(C,13,W)),3)) [/code:1:a19911fd6c] Try replacing the code above by Ref( (Mov(C,13,W)),-3)) Patrick :mrgreen:
hbjerry  
#10 Posted : Sunday, November 6, 2005 5:51:35 PM(UTC)
hbjerry

Rank: Newbie

Groups: Registered, Registered Users, Subscribers
Joined: 9/29/2005(UTC)
Posts: 7

That cut down the signals but still missing to many cross overs and the ribbon should have no black,should only be green or red.It's mostley black now.
Patrick  
#11 Posted : Sunday, November 6, 2005 5:59:16 PM(UTC)
Patrick

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 9/8/2004(UTC)
Posts: 2,266

Was thanked: 1 time(s) in 1 post(s)
Replace your cross functions by > and < and then use the Latch function from the forum dll to only get one buy and one sell etc ... Read the ForumDll manual about the latch function. Patrick :mrgreen:
hbjerry  
#12 Posted : Tuesday, November 8, 2005 11:15:37 PM(UTC)
hbjerry

Rank: Newbie

Groups: Registered, Registered Users, Subscribers
Joined: 9/29/2005(UTC)
Posts: 7

this seems to work [code:1:10bb150637]bull mov( CLOSE, 9, E ) > ((ref(Close,-3)+ref(Close,-4)+ref(Close,-5)+ref(Close,-6)+ref(Close,-7)+ref(Close,-8)+ref(Close,-9)+ref(Close,-10)+ref(Close,-11)+ref(Close,-12)+ref(Close,-13)) / 11 ) bear mov( CLOSE, 9, E ) < ((ref(Close,-3)+ref(Close,-4)+ref(Close,-5)+ref(Close,-6)+ref(Close,-7)+ref(Close,-8)+ref(Close,-9)+ref(Close,-10)+ref(Close,-11)+ref(Close,-12)+ref(Close,-13)) / 11 ) buy cross(Mov( CLOSE, 9, E ), ((ref(Close,-3)+ref(Close,-4)+ref(Close,-5)+ref(Close,-6)+ref(Close,-7)+ref(Close,-8)+ref(Close,-9)+ref(Close,-10)+ref(Close,-11)+ref(Close,-12)+ref(Close,-13)) / 11 )) sell cross(((ref(Close,-3)+ref(Close,-4)+ref(Close,-5)+ref(Close,-6)+ref(Close,-7)+ref(Close,-8)+ref(Close,-9)+ref(Close,-10)+ref(Close,-11)+ref(Close,-12)+ref(Close,-13)) / 11 ), Mov( CLOSE, 9, E )) [/code:1:10bb150637]Any way to do this without all the ref's?
Jose  
#13 Posted : Wednesday, November 9, 2005 6:16:12 AM(UTC)
Jose

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 1/19/2005(UTC)
Posts: 1,065
Location: Koh Pha-Ngan, Earth

Was thanked: 2 time(s) in 2 post(s)
The MS code below will plot exactly the same signals as the longer code above. [code:1:9676ba8c38] Bull ---8<-------------------------- Mov(C,9,E)>Ref(Sum(C,11),-3)/11 ---8<-------------------------- Bear ---8<-------------------------- Mov(C,9,E)<Ref(Sum(C,11),-3)/11 ---8<-------------------------- Buy ---8<--------------------------------- Cross(Mov(C,9,E),Ref(Sum(C,11),-3)/11) ---8<--------------------------------- Sell ---8<--------------------------------- Cross(Ref(Sum(C,11),-3)/11,Mov(C,9,E)) ---8<--------------------------------- [/code:1:9676ba8c38] jose '-)
hbjerry  
#14 Posted : Friday, November 11, 2005 8:05:43 PM(UTC)
hbjerry

Rank: Newbie

Groups: Registered, Registered Users, Subscribers
Joined: 9/29/2005(UTC)
Posts: 7

Thanks jose,how would i change the 11 simple to weighted?
Jose  
#15 Posted : Friday, November 11, 2005 8:54:17 PM(UTC)
Jose

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 1/19/2005(UTC)
Posts: 1,065
Location: Koh Pha-Ngan, Earth

Was thanked: 2 time(s) in 2 post(s)
Using the Bull example: [code:1:dd2a8145df]Mov(C,9,E)>Ref(Sum(C,11),-3)/11[/code:1:dd2a8145df] ...is the same as: [code:1:dd2a8145df]Mov(C,9,E)>Ref(Mov(C,11,S),-3)[/code:1:dd2a8145df] So, a weighted version of the SMA portion above would be: [code:1:dd2a8145df]Mov(C,9,E)>Ref(Mov(C,11,W),-3)[/code:1:dd2a8145df] jose '-)
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.