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

Notification

Icon
Error

Options
Go to last post Go to first unread
deanms  
#1 Posted : Thursday, November 17, 2005 10:33:21 PM(UTC)
deanms

Rank: Newbie

Groups: Registered, Registered Users, Subscribers
Joined: 11/17/2005(UTC)
Posts: 3
Location: Dallas, TX

BB_MACD I'm new to MetaStock yet use this custom indicator. The attached jpg file shows the indicator. Long entry = blue line crosses above green line Long exit = after above green line, blue line crosses below green line Short entry = blue line crosses below red line Short exit = after below red line, blue line crosses above green line Below is the code found in the TradeStation Easy Language. Any assistance would be most appreciated. Thank you, Dean
INPUTS: FastLen( 12), SlowLen( 26), Length( 10), StDv(1), offset (0); VARS: BB_Macd(0), Avg(0), SDev(0), Upper_band(0), Lower_band(0), macd_bb_trendup (false), macd_bb_trenddown (false); BB_Macd= MACD( Close, FastLen, SlowLen ) ; Avg = XAverage(BB_Macd,Length); SDev = StdDev( BB_Macd, Length ) ; Upper_Band = Avg + StDv * SDev ; Lower_Band = Avg - StDv * SDev ; If BB_MACD crosses above lower_band then begin macd_bb_trendup=true; macd_bb_trenddown=false; end; If BB_MACD crosses below lower_band then begin macd_bb_trendup=false; macd_bb_trenddown=true; end; If macd_bb_trendup=false and macd_bb_trenddown[1]=false then begin Plot1(Low-offset,"uptrend"); end; If macd_bb_trenddown=false and macd_bb_trendup[1]=false then begin Plot2(High+ offset,"dwntrend"); end;UserPostedImage
StorkBite  
#2 Posted : Friday, November 18, 2005 2:46:05 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)
Please repost your graphics using the 'Add image to post' feature instead of the 'add an attachment' feature. Thanks.
wabbit  
#3 Posted : Friday, November 25, 2005 5:02:42 AM(UTC)
wabbit

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)
To plot the three lines: FastLen:=12; SlowLen:=26; Length:=10; StDv:=1; offset:=0; myMACD:=Mov(C,FastLen,E)-Mov(C,SlowLen,E); Avg:=Mov(myMACD,Length,E); BBTop:=BBandTop(myMACD,Length,E,stDv); BBBot:=BBandBot(myMACD,Length,E,stDv); myMACD; BBTop; BBBot; To use Roy Larsens Latch function for the long and short entry and exits: FastLen:=12; SlowLen:=26; Length:=10; StDv:=1; offset:=0; myMACD:=Mov(C,FastLen,E)-Mov(C,SlowLen,E); Avg:=Mov(myMACD,Length,E); BBTop:=BBandTop(myMACD,Length,E,stDv); BBBot:=BBandBot(myMACD,Length,E,stDv); myMACD; BBTop; BBBot; N:=myMACD>BBTop; X:=myMACD<BBBot; I:=Cum(N+X>-1)=1; Tr:=BarsSince(I OR N)<BarsSince(I OR X); Tr*HHV(myMACD,100); {Tr>0 is LONG, Tr=0 is SHORT} {This bit can be more easily achieved if you have the Forum.dll !} Hope this helps. If it isnt quite right let me know. wabbit :D
deanms  
#4 Posted : Tuesday, November 29, 2005 8:04:51 PM(UTC)
deanms

Rank: Newbie

Groups: Registered, Registered Users, Subscribers
Joined: 11/17/2005(UTC)
Posts: 3
Location: Dallas, TX

Wabbit, Thanks...much appreciated! I'll test it. Dean
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.