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

Notification

Icon
Error

Options
Go to last post Go to first unread
bigchan  
#1 Posted : Monday, May 28, 2007 8:44:25 AM(UTC)
bigchan

Rank: Newbie

Groups: Registered, Registered Users, Subscribers
Joined: 5/28/2007(UTC)
Posts: 2

Hi All

May i know how to code the formula for explore for stock in pass 5 days that having MACD below -0.5

Thank alot

Best Rdgs

Big

*PP  
#2 Posted : Monday, May 28, 2007 9:50:47 AM(UTC)
*PP

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 4/1/2006(UTC)
Posts: 135
Location: Romania

hi Big,

Not sure exactly what u want but here it its:

llv(macd(),5)<-0.5

if this is not what u have asked for then please be more precise and i will try to help. I strongly recommend u to read metastock help and formula primer because in there u will find all answers to such basic questions and much more if ur imagination allows.

Also, welcome to the forum, u should try traders consortium forum as well. http://tradersconsortium.com

Cheers

Jose  
#3 Posted : Monday, May 28, 2007 12:31:39 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)
BigChan, the main problem that you will encounter with this strategy is that the MACD's scale is not constant - it is directly related to the security's price. You will get large MACD values when applied to an index, and conversely, small values on cheap stocks (i.e., the MACD will never reach -0.5). The solution to this problem is to either normalize the MACD to +/-100%, or code automatic over/Bought/Sold levels that are relative to the MACD's scale. I'm unable to post your code solution in this forum due to copyright issues. Please re-post your MetaStock query at the Trader's Consortium MetaStock forum, and I will personally take a good look at your request and offer a quality solution. jose '-)
hayseed  
#4 Posted : Monday, May 28, 2007 8:19:11 PM(UTC)
hayseed

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 3/7/2005(UTC)
Posts: 1,346

hey chan..... you can use alert and cross ..... Alert(Cross(-.5, MACD()) , 5) ..... a very breif example is below ..... included a similar scan for stoch(5,3) but for past 9 days as comparison.....

v10 will excell in explorations such as this due to its additional columns..... h


Exploration notes

Col A: macd >

{macd closing above .5 within past 5 days}

Alert(Cross(MACD(), .5),5)


Col B: macd <

{macd closing below -.5 within past 5 days}

Alert(Cross(-.5, MACD()),5)


Col C: stoch >

{stoch closing above 80 within past 9 days}

Alert(Cross(Stoch(5,3), 80),9)


Col D: stoch <

{stoch closing below 10 within past 9 days}

Alert(Cross(10,Stoch(5,3)),9)


Filter colA OR colB OR colC OR colD

Filter enabled Yes
Periodicity Daily
Records required 35

bigchan  
#5 Posted : Thursday, May 31, 2007 1:09:55 AM(UTC)
bigchan

Rank: Newbie

Groups: Registered, Registered Users, Subscribers
Joined: 5/28/2007(UTC)
Posts: 2

Thank you for you guys help, actually i want to scan for stock that have very low MACD during pass 5 days or maybe 10datys..

Thank alot

Bigchan

hayseed  
#6 Posted : Thursday, May 31, 2007 6:44:32 AM(UTC)
hayseed

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 3/7/2005(UTC)
Posts: 1,346

hey chan..... column b above should do it... the only adjustments needed would be the lower than value and now apparently the lookback days...... if you included an extra column for just the "macd() you could verify macd value...... h

-----------------------------------

Col B: macd <

{macd closing below -.5 within past 5 days}

Alert(Cross( -.5, MACD()), 5 )

-------------------------------------

or macd closing below -.7 during the last 10 days...

---------------------------------------------------

Col c: macd <

{macd closing below -.7 within past 10 days}

Alert(Cross( -.7, MACD()),10)

-------------------------------------------------

Col d: macd <

{macd closing below -.3 within past 9 days}

Alert(Cross( -.3, MACD()),9)

--------------------------------------

col e: macd

macd()

pumrysh  
#7 Posted : Thursday, May 31, 2007 5:05:02 PM(UTC)
pumrysh

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 10/28/2004(UTC)
Posts: 110

BigChan,

Have to agree with everything that has been said thus far. MACD is a calculation of one moving average subtracted from another thus the values will not be the same because of the differences in price values. Normalizing is the way to go. Here's a normalizing formula that I posted on another group site recently that should work for you with the MACD already plugged in.

{Normalized MACD Indicator}
Ind:=MACD();
Npds:=Input("periods to normalize",
1,100,5);
Norm:=(Ind-LLV(Ind,Npds))
/(HHV(Ind,Npds)-LLV(Ind,Npds)+.0000001)*100;
Norm; {end}

Consider the normalizing periods as a lookback period. The scale will now be from 0 to 100. I strongly urge you to place this formula in a window on a chart along with a MACD and compare them. You requested a 5 day period so I plugged that in as a default. You may wish to play with this a bit to get it more to your liking.

Hope this helps,

Preston

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.