Back to www.cobrasmarketview.com

03/22/2013 Live Update

gasprice
Posts: 33
Joined: Mon Feb 25, 2013 3:59 pm

Re: 03/22/2013 Live Update

Post by gasprice »

Folks were asking for code to find stocks in consolidations automatically. Here's one method. I call it "MACD Power".

What I do is look for a specific MACD pattern which indicates a potential strong move higher could be coming. Here's the circumstance

-- MACD 30 bars ago peaked and started to fall
-- Price fell a certain amount, MACD fell a certain amount
-- Take the percent the MACD fell and divide it by the percent the price fell
-- A higher value indicates a stronger stock

So say the MACD has fallen 80% and price fell 2% in one stock. Another stock, MACD has fallen 60% and price fell 2%. The first stock has a power rating of 40 and the second stock has a power rating of 30. The first stock is a better buy. Why? Because in the time it took for the MACD to fall more, price fell the same as another stock where MACD didn't fall as much.

Ninja Trader code -- run this in a Market Analyzer across all NYSE/NASDAQ stocks to find the highest power rating.

protected override void OnBarUpdate()
{
double oldMACD = 0;
double newMACD = 0;
double maxMACD = 0;
double oldPrice = 0;
double newPrice = 0;
double changeMACD = 0;
double changePrice = 0;
double result = 0;

if(CurrentBar > 32)
{
// Get the MACD from 30 bars back and calculate the percent change

oldMACD = MACD(12,26,9)[30];
newMACD = MACD(12,26,9)[0];
maxMACD = MAX(MACD(12,26,9), 31)[0];

changeMACD = Math.Abs(100*(newMACD - oldMACD)/oldMACD);

// Get the price from 30 bars back and calculate percent change

oldPrice = Close[30];
newPrice = Close[0];

changePrice = Math.Abs(100*(newPrice - oldPrice)/oldPrice);

// Calculate if:
// MACDs are both > 0
// The MACD 30 bars ago was the max
// Stock has fallen

if (oldMACD > 0 &&
newMACD > 0 &&
oldMACD == maxMACD &&
newPrice < oldPrice)
{
result = (changeMACD / changePrice) * 100 ;
}
else
{
result = 0;
}

}
else
{
result = 0;
}

Plot0.Set(result);
}

Here's an example of a stock that the scan picked up a week ago (ATK)
Attachments
sc.png
f-stop
Posts: 39
Joined: Mon Oct 17, 2011 10:22 am

Re: 03/22/2013 Live Update

Post by f-stop »

Anyone following URTY? Not acting like a 3x today v.s. TNA
Thoughts?
TraderGirl
Posts: 5031
Joined: Thu Dec 22, 2011 2:47 pm

Re: 03/22/2013 Live Update

Post by TraderGirl »

Gettin' the feeling we get a move down for TMF/TLT...
Attachments
Screen Shot 2013-03-22 at 8.19.25 AM.png
User avatar
Out of Bounds
Posts: 5623
Joined: Wed Feb 23, 2011 10:11 am
Location: Miami

Re: 03/22/2013 Live Update

Post by Out of Bounds »

resistance broke
...
User avatar
stlwater
Posts: 613
Joined: Fri Nov 04, 2011 2:00 pm

Re: 03/22/2013 Live Update

Post by stlwater »

gasprice wrote:Folks were asking for code to find stocks in consolidations automatically. Here's one method. I call it "MACD Power".

What I do is look for a specific MACD pattern which indicates a potential strong move higher could be coming. Here's the circumstance

-- MACD 30 bars ago peaked and started to fall
-- Price fell a certain amount, MACD fell a certain amount
-- Take the percent the MACD fell and divide it by the percent the price fell
-- A higher value indicates a stronger stock

So say the MACD has fallen 80% and price fell 2% in one stock. Another stock, MACD has fallen 60% and price fell 2%. The first stock has a power rating of 40 and the second stock has a power rating of 30. The first stock is a better buy. Why? Because in the time it took for the MACD to fall more, price fell the same as another stock where MACD didn't fall as much.

Ninja Trader code -- run this in a Market Analyzer across all NYSE/NASDAQ stocks to find the highest power rating.

protected override void OnBarUpdate()
{
double oldMACD = 0;
double newMACD = 0;
double maxMACD = 0;
double oldPrice = 0;
double newPrice = 0;
double changeMACD = 0;
double changePrice = 0;
double result = 0;

if(CurrentBar > 32)
{
// Get the MACD from 30 bars back and calculate the percent change

oldMACD = MACD(12,26,9)[30];
newMACD = MACD(12,26,9)[0];
maxMACD = MAX(MACD(12,26,9), 31)[0];

changeMACD = Math.Abs(100*(newMACD - oldMACD)/oldMACD);

// Get the price from 30 bars back and calculate percent change

oldPrice = Close[30];
newPrice = Close[0];

changePrice = Math.Abs(100*(newPrice - oldPrice)/oldPrice);

// Calculate if:
// MACDs are both > 0
// The MACD 30 bars ago was the max
// Stock has fallen

if (oldMACD > 0 &&
newMACD > 0 &&
oldMACD == maxMACD &&
newPrice < oldPrice)
{
result = (changeMACD / changePrice) * 100 ;
}
else
{
result = 0;
}

}
else
{
result = 0;
}

Plot0.Set(result);
}

Here's an example of a stock that the scan picked up a week ago (ATK)
Great info, thanks!
User avatar
Out of Bounds
Posts: 5623
Joined: Wed Feb 23, 2011 10:11 am
Location: Miami

Re: 03/22/2013 Live Update

Post by Out of Bounds »

Sold longs. I'm out. Have a great weekend guys.
...
User avatar
Out of Bounds
Posts: 5623
Joined: Wed Feb 23, 2011 10:11 am
Location: Miami

Re: 03/22/2013 Live Update

Post by Out of Bounds »

and Gals.
...
User avatar
JFR
Posts: 11238
Joined: Sun Dec 02, 2012 7:24 pm

Re: 03/22/2013 Live Update

Post by JFR »

gasprice wrote:Folks were asking for code to find stocks in consolidations automatically. Here's one method. I call it "MACD Power".

What I do is look for a specific MACD pattern which indicates a potential strong move higher could be coming. Here's the circumstance

-- MACD 30 bars ago peaked and started to fall
-- Price fell a certain amount, MACD fell a certain amount
-- Take the percent the MACD fell and divide it by the percent the price fell
-- A higher value indicates a stronger stock

So say the MACD has fallen 80% and price fell 2% in one stock. Another stock, MACD has fallen 60% and price fell 2%. The first stock has a power rating of 40 and the second stock has a power rating of 30. The first stock is a better buy. Why? Because in the time it took for the MACD to fall more, price fell the same as another stock where MACD didn't fall as much.

Ninja Trader code -- run this in a Market Analyzer across all NYSE/NASDAQ stocks to find the highest power rating.

protected override void OnBarUpdate()
{
double oldMACD = 0;
double newMACD = 0;
double maxMACD = 0;
double oldPrice = 0;
double newPrice = 0;
double changeMACD = 0;
double changePrice = 0;
double result = 0;

if(CurrentBar > 32)
{
// Get the MACD from 30 bars back and calculate the percent change

oldMACD = MACD(12,26,9)[30];
newMACD = MACD(12,26,9)[0];
maxMACD = MAX(MACD(12,26,9), 31)[0];

changeMACD = Math.Abs(100*(newMACD - oldMACD)/oldMACD);

// Get the price from 30 bars back and calculate percent change

oldPrice = Close[30];
newPrice = Close[0];

changePrice = Math.Abs(100*(newPrice - oldPrice)/oldPrice);

// Calculate if:
// MACDs are both > 0
// The MACD 30 bars ago was the max
// Stock has fallen

if (oldMACD > 0 &&
newMACD > 0 &&
oldMACD == maxMACD &&
newPrice < oldPrice)
{
result = (changeMACD / changePrice) * 100 ;
}
else
{
result = 0;
}

}
else
{
result = 0;
}

Plot0.Set(result);
}

Here's an example of a stock that the scan picked up a week ago (ATK)
Thanks for the code. I will try it on Ninja. It looks to me like a Stockcharts scan with SCTRs finds much the same thing.
Attachments
atk.png
Charts posted are not recommendations. They are just a sharing of information.
User avatar
BullBear52x
Posts: 30709
Joined: Tue Feb 22, 2011 3:47 pm

Re: 03/22/2013 Live Update

Post by BullBear52x »

Out of Bounds wrote:resistance broke
gap filled just now.
My comments are for entertainment/educational purpose only. NOT a trade advice.
User avatar
Cobra
Site Admin
Posts: 61832
Joined: Sat Feb 12, 2011 10:29 pm

Re: 03/22/2013 Live Update

Post by Cobra »

possible targets.
Attachments
1.png

Like to read more of my commentaries? Please subscribe my Daily Market Report.
Subscribers can find all the members only posts HERE.
StockCharts members, please vote for me HERE, thanks.
TradingJackal
Posts: 565
Joined: Wed Feb 08, 2012 3:54 pm
Contact:

Re: 03/22/2013 Live Update

Post by TradingJackal »

ES
Attachments
ES
ES
There are no bulls or bears in the market. Only wolves and sheep.
Twitter @TradingJackal
http://tradingjackal.blogspot.com/
User avatar
Al_Dente
Posts: 28535
Joined: Thu Jul 21, 2011 2:29 pm

Re: 03/22/2013 Live Update

Post by Al_Dente »

322cyprus.png
Disclaimer: I am not an investment advisor. This is just my opinion NOT investment advice.
fehro
Posts: 22880
Joined: Fri Sep 02, 2011 2:06 pm

Re: 03/22/2013 Live Update

Post by fehro »

little bearish rising wedge?.. and channels on SPX 5m
Attachments
Screen shot 2013-03-22 at 8.39.12 AM.png
User avatar
Cobra
Site Admin
Posts: 61832
Joined: Sat Feb 12, 2011 10:29 pm

Re: 03/22/2013 Live Update

Post by Cobra »

pullback too large, so forget about the targets, the bias still is up though. here's the common pattern.
Attachments
1.png

Like to read more of my commentaries? Please subscribe my Daily Market Report.
Subscribers can find all the members only posts HERE.
StockCharts members, please vote for me HERE, thanks.
User avatar
gappy
Posts: 3163
Joined: Tue Nov 22, 2011 3:34 pm
Location: Peapatch Tx

Re: 03/22/2013 Live Update

Post by gappy »

Al_Dente wrote:
322cyprus.png
Where did I read that France was the elephant in the room? Anyways I just shorted Terex cause Europe is a mess. :shock: Just for you Dr Al: http://www.youtube.com/watch?v=liKhLNY5GYI
‘the petrodollar is our currency and our problem’....Gappy
TraderGirl
Posts: 5031
Joined: Thu Dec 22, 2011 2:47 pm

Re: 03/22/2013 Live Update

Post by TraderGirl »

XIV... A pullback here would not necessarily be bearish...

this looks like a bull flag...
Attachments
Screen Shot 2013-03-22 at 8.46.05 AM.png
johnnywa
Posts: 1030
Joined: Tue Aug 23, 2011 11:09 am

Re: 03/22/2013 Live Update

Post by johnnywa »

Canary in the coal mine IWM ????
Xian
Posts: 876
Joined: Tue Aug 02, 2011 10:03 am

Re: 03/22/2013 Live Update

Post by Xian »

Al_Dente wrote:
322cyprus.png
If Cyprus was America:

"...plan requires Cyprus to come up with about $7.5 billion as its share of the bailout. That’s roughly a third of their GDP. To put that into local terms, it would be as if the United States were being asked to pony up $5 trillion."

http://www.washingtonpost.com/blogs/won ... s-america/

"hope you guessed my name......"

http://www.youtube.com/watch?v=vBecM3CQVD8
User avatar
L_T
Posts: 1609
Joined: Tue Sep 13, 2011 9:49 am

Re: 03/22/2013 Live Update

Post by L_T »

johnnywa wrote:Canary in the coal mine IWM ????
That's what I was thinking this morning......
Daniel-David
Posts: 363
Joined: Thu May 17, 2012 10:27 am

Re: 03/22/2013 Live Update

Post by Daniel-David »

After prolonged plunge taking it to a fresh loss YTD, Brazil etf EWZ testing its (still upslope) 200day MA. A possible place for a sharp snapback rally if emerging markets in general firm for the day..?
Post Reply