Search the web
Sign In
New User? Sign Up
amibroker · AmiBroker User's List
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Want your group to be featured on the Yahoo! Groups website? Add a group photo to Flickr.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
MACD Histogram   Message List  
Reply | Forward Message #116233 of 143809 |
MACD Histogram

Hi everyone,

I just bought Amibroker for stocks trading. I usually use a small
setup criteria to scan for my stocks but now I can't :(

I would like to seek help to write the scanner.

Settings:
MACD default,
I look for Histogram 4 down bars and 1 up bar for buy signal(I used to
have the histogram set to red for down and blue for up so I can see
clearly) I have this indicator but was give to me with another setting

MACD above Zero Line

RSI Above 30

This system is base on trend trading. Buying on pullback when the
market continue its up trend.

Thank you for your help in advance, greatly appreciated :)




r1 = Param( "Fast avg", 12, 2, 200, 1 );
r2 = Param( "Slow avg", 26, 2, 200, 1 );
r3 = Param( "Signal avg", 9, 2, 200, 1 );
Plot( ml = MACD(r1, r2), StrFormat(_SECTION_NAME()+"(%g,%g)", r1, r2),
ParamColor("MACD color", colorAqua ), ParamStyle("MACD style",
styleThick) );
Plot( sl = Signal(r1,r2,r3), "Signal" + _PARAM_VALUES(),
ParamColor("Signal color", colorRed ), ParamStyle("Signal style",
styleThick) );
//Plot( ml-sl, "MACD Histogram", ParamColor("Histogram color",
colorBlack ), styleNoTitle | ParamStyle("Histogram style",
styleHistogram | styleNoLabel, maskHistogram ) );

m1=MACD(r1,r2);
s1=Signal(r1,r2,r3);
Hist= m1-s1;
Histprev=Ref(Hist,-1);

Color = IIf(Hist>Histprev,ParamColor("MACD-H Up Color", colorGreen),
IIf(hist<histprev,ParamColor("MACD-H Down
Color",colorCustom16),colorRed));

Plot(m1-s1,"MACD Histogram",Color,styleHistogram|styleNoTitle|styleThick);



SetChartBkGradientFill( ParamColor("Backgroud Top Color",
colorRed),ParamColor("Background Bottom Color", colorDarkGrey));



//This indicator shows the value of tomorrow's Closing Price
//in order for the slope of the MACD Histogram to change Direction.
//(ie. changing from a positive slope to a negative slope OR changing
//from a negative slope to a positive slope)
GraphXSpace = 8;


f1 = ((r3+1)*M1-2*S1)/(r3-1);
f2 = EMA(C,r1)*(r1-1)/(r1+1);
f3 = EMA(C,r2)*(r2-1)/(r2+1);
f4 = 2/(r1+1) - 2/(r2+1);

dcv = (f1-f2+f3)/ f4;


Title = Name() + " - " + FullName() + " - " + Date() + " - Close
= " +
WriteVal(C,0.3) + " - DCV = " + WriteVal(dcv,0.3);




Wed Oct 17, 2007 4:12 pm

protraderinc
Offline Offline
Send Email Send Email

Forward
Message #116233 of 143809 |
Expand Messages Author Sort by Date

Thanks, Terry! ... like the ... price with 52 ... up ... can change ... become more ... 1,1); ... Line",colorWhite,styledashed+styleOwnScale,-1,1); ... in ... ...
stocktocker
Offline Send Email
Jan 10, 2005
1:06 am

Hi everyone, I just bought Amibroker for stocks trading. I usually use a small setup criteria to scan for my stocks but now I can't :( I would like to seek...
protraderinc
Offline Send Email
Oct 17, 2007
4:54 pm

Hi protraderinc I made a few additions to your afl on the indicator side (attached). Thought you might like to see it, bottom panel. Roger...
Roger
rogerbr2001
Offline Send Email
Oct 18, 2007
2:08 am

Hi Roger, Thank you for taking you time to look at it :) Its very nice. I find it useful. You trade futures right? Are you into stocks? I bought...
David LW
protraderinc
Offline Send Email
Oct 18, 2007
5:06 am

Hi David I only trade futures. Have never used the scan feature of Amibroker and I am not a programmer. Just do some cut and paste from one formula to ...
Roger
rogerbr2001
Offline Send Email
Oct 18, 2007
2:46 pm

Hi Roger, Thank you so much for the time :) Regards David Roger <rogerzzzz@...> wrote: Hi David I only trade futures....
David LW
protraderinc
Offline Send Email
Oct 18, 2007
11:55 pm

Just add something like this properly including your conditions and then scan: Buy = iif(sum(hist > histprev, 5) == 4 and ref(hist < histprev, -1), 1, 0); Bill...
wavemechanic
fimdot
Offline Send Email
Oct 17, 2007
6:24 pm

OK, here is a simplified version that you can add to: First, let's be clear on your condition. As I understand, you want to buy when have 4 consecutive (I...
wavemechanic
fimdot
Offline Send Email
Oct 18, 2007
4:25 pm

Thank you so much Bill. the scanner works exactly. I really appreciate you taking your time to advise and construct it. Thank you :) Thank you and best regards...
David LW
protraderinc
Offline Send Email
Oct 19, 2007
10:15 am

I have tried to use the difference in the MACD Histogram from one day to another, but it is not working correctly. Hist1 = MACD() - Signal(); Condition13 =...
professor77747
Offline Send Email
Oct 26, 2007
4:24 pm

Based on your question, I assume that your formula is: buy = condition13 + other conditions; What are the other conditions? Is there an interaction between...
wavemechanic
fimdot
Offline Send Email
Oct 26, 2007
5:10 pm

Bill, Thank you for your reply. To check out this condition, I reduced wrote a formula with just 2 conditions. Here is the formula, _SECTION_BEGIN("2...
professor@...
professor77747
Offline Send Email
Oct 26, 2007
6:13 pm

I don't think so. Your buy = macd > ref(macd) and hist < ref(hist). However, the data you presented has macd > ref(macd) and hist > ref(hist) so the buy...
wavemechanic
fimdot
Offline Send Email
Oct 26, 2007
7:19 pm

Bill, Thank you. I didn't notice that. I guess that I am doing this all wrong. What I want is to have the condition met when the gap between the MACD and...
professor@...
professor77747
Offline Send Email
Oct 27, 2007
1:13 am

Your code and words don't match. I assume that your words are correct. "I want the buy condition to be when the MACD is below the Signal and the gap is...
wavemechanic
fimdot
Offline Send Email
Oct 27, 2007
2:30 am

... From: wavemechanic To: amibroker@yahoogroups.com Sent: Friday, October 26, 2007 7:26 PM Subject: Re: [amibroker] MACD Histogram Your code and words don't...
professor@...
professor77747
Offline Send Email
Oct 27, 2007
3:55 am

Bill, Thank you so much. I made the changes that you suggested and it seems to work. Tom From: wavemechanic To: amibroker@yahoogroups.com Sent: Friday, October...
professor@...
professor77747
Offline Send Email
Oct 27, 2007
4:02 am

Hi, I am having a little difficulty with an AFL formula. I want to compare one weeks MACD Histogram value to the previous weeks MACD Histogram value. My code...
earlvanvigil
Offline Send Email
Dec 19, 2007
5:19 pm
 First  |  |  Next > Last 
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help