[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [amibroker] Graham- please check code



PureBytes Links

Trading Reference Links




Try this, it seemed the yellow was 
causing the problem ROC(15) instead of ROC(C,15) and I also changed the values 
slightly for the red, yellow and green limits so all numbers would be 
covered
 
//Program
Range = (Close<FONT 
size=2>-Low<FONT 
size=2>)/(High<FONT 
size=2>-Low<FONT 
size=2>)*100;
Vol = (V<FONT 
size=2>/MA<FONT 
size=2>(V<FONT 
size=2>,30<FONT 
size=2>))*100<FONT 
size=2>;
//Strength Meter
Green = ROC<FONT 
size=2>(C<FONT 
size=2>,15<FONT 
size=2>)>=<FONT 
color=#ff00ff size=2>10;
Yellow = ROC<FONT 
size=2>(<FONT face="Courier New" color=#ff0000 
size=2>C,<FONT 
color=#ff00ff size=2>15)>-<FONT 
face="Courier New" color=#ff00ff size=2>10<FONT color=#ff00ff 
size=2>.0 <FONT color=#ff0000 
size=2>AND <FONT color=#0000ff 
size=2>ROC(<FONT color=#ff0000 
size=2>C,<FONT color=#ff00ff 
size=2>15)<<FONT face="Courier New" 
color=#ff00ff size=2>10;
Red = ROC<FONT 
size=2>(C<FONT 
size=2>,15) 
<= 
-10<FONT 
size=2>;
Buy=<FONT color=#ff0000 
size=2>C><FONT color=#ff00ff 
size=2>0 <FONT color=#ff0000 
size=2>AND <FONT color=#ff0000 
size=2>C<<FONT color=#ff00ff 
size=2>15 <FONT color=#ff0000 
size=2>AND
RSI( <FONT color=#ff00ff 
size=2>14 )><FONT color=#ff00ff 
size=2>70 <FONT color=#ff0000 
size=2>AND
ADX(<FONT color=#ff00ff 
size=2>14)><FONT color=#ff00ff 
size=2>30 <FONT color=#ff0000 
size=2>AND
MA(<FONT color=#ff0000 
size=2>V,<FONT color=#ff00ff 
size=2>30)><FONT color=#ff00ff 
size=2>100000 <FONT color=#ff0000 
size=2>AND
V><FONT color=#ff00ff 
size=2>200000;<FONT color=#ff0000 
size=2>
Filter=<FONT 
face="Courier New" color=#ff00ff size=2>1<FONT 
face="Courier New" color=#000000 size=2>;<FONT 
face=Arial size=3>
//Filter=<FONT 
color=#008000 size=2>Buy<FONT face="Courier New" color=#008000 
size=2>;
AddColumn(<FONT color=#ff0000 
size=2>C,<FONT color=#8b0000 
size=2>"close",<FONT color=#ff00ff 
size=2>1.2);
AddColumn(<FONT color=#0000ff 
size=2>MA(<FONT color=#ff0000 
size=2>C,<FONT color=#ff00ff 
size=2>10),<FONT color=#8b0000 
size=2>"10dma",<FONT color=#ff00ff 
size=2>1);
AddColumn(<FONT color=#0000ff 
size=2>ADX(<FONT color=#ff00ff 
size=2>14),<FONT color=#8b0000 
size=2>"ADX",<FONT color=#ff00ff 
size=2>1);
AddColumn(<FONT color=#0000ff 
size=2>RSI(<FONT color=#ff00ff 
size=2>14),<FONT color=#8b0000 
size=2>"RSI",<FONT color=#ff00ff 
size=2>1.2);
AddColumn(<FONT color=#0000ff 
size=2>ROC(<FONT color=#ff0000 
size=2>C,<FONT color=#ff00ff 
size=2>5),"5 D 
Chg",<FONT color=#ff00ff 
size=2>1.2);
AddColumn(Range,<FONT color=#8b0000 
size=2>"Rng%",<FONT color=#ff00ff 
size=2>1.2);
AddColumn(Vol,<FONT color=#8b0000 
size=2>"VOL%",<FONT color=#ff00ff 
size=2>1);
AddColumn(<FONT color=#0000ff 
size=2>StochD(<FONT color=#ff00ff 
size=2>14,<FONT color=#ff00ff 
size=2>3),<FONT color=#8b0000 
size=2>"STO",<FONT color=#ff00ff 
size=2>1);
AddColumn(<FONT color=#ff0000 
size=2>V,<FONT color=#8b0000 
size=2>"Volume",<FONT color=#ff00ff 
size=2>1);
AddColumn(<FONT color=#0000ff 
size=2>MA(<FONT color=#ff0000 
size=2>C,<FONT color=#ff00ff 
size=2>10),<FONT color=#8b0000 
size=2>"10dma",<FONT color=#ff00ff 
size=2>1.2);

color = IIf<FONT 
size=2>(green, colorGreen<FONT 
size=2>, IIf<FONT 
size=2>(yellow, colorYellow<FONT 
size=2>, colorRed<FONT 
size=2>)); 
AddTextColumn( <FONT color=#0000ff 
size=2>WriteIf(Green,<FONT color=#8b0000 
size=2>"GRN",<FONT color=#0000ff 
size=2>WriteIf (Yellow,<FONT color=#8b0000 
size=2>"YEL",<FONT color=#8b0000 
size=2>"RED")),<FONT color=#8b0000 
size=2>"Strength Meter" , <FONT color=#ff00ff 
size=2>1, <FONT color=#ff0000 
size=2>colorDefault, color); 
Cheers,Graham<A 
href="">http://groups.msn.com/asxsharetrading<A 
href="">http://groups.msn.com/fmsaustralia-----Original 
Message-----From: mroman59 [<A 
href="">mailto:mroman59@xxxxxxxxx]Sent: 
Tuesday, 30 December 2003 9:19 AMTo: amibroker@xxxxxxxxxxxxxxxSubject: 
[amibroker] Graham- please check codeHello GrahamThe other 
day I posted and you replyed concerning my code questionin AB. I spoke to 
early when I said that the code you gave me wasworking correctly. I am 
having sum bugs in the program and wouldlike to know if you could take a 
look at it?  The only problem rightnow is that any stock that fills the 
criteria for the "Red" variableis not showing up as the color red in the 
Strength Meter column. The colors greeen and yellow work however.  
I varified the colorswith the stocks raw data and by the following add 
columns below://AddColumn(result = 
IIf(Green,1,0),"GRN");//AddColumn(result = IIf( Yellow,2,0),"YEL"); 
//AddColumn(result = IIf( Red,3,0),"RED");The above code, when active 
reports either a 1,2 or 3 in the columnbut the stocks with a 3 are not 
showing up as a red color. Thefollowing code is part of my program and you 
may have to chage thecriteria for "Buy" to generate stocks with the value of 
3 to seewhat I am talking about. I have tried various variations of 
theWriteIF statement, but with no luck. Your help is appreciated, 
MR//ProgramRange = (Close-Low)/(High-Low)*100;Vol = 
(V/MA(V,30))*100;//Strength MeterGreen = ROC(C,15)>10;Yellow 
=  ROC(15)>-9.0 AND ROC(C,15)<9.999;Red = ROC(C,15) < 
-9.999;Buy=C>0 AND C<15 ANDRSI( 14 )>70 
ANDADX(14)>30 ANDMA(V,30)>100000 
ANDV>200000;Filter=Buy;AddColumn(C,"close",1.2);AddColumn(MA(C,10),"10dma",1);AddColumn(ADX(14),"ADX",1);AddColumn(RSI(14),"RSI",1.2);AddColumn(ROC(C,5),"5 
D 
Chg",1.2);AddColumn(Range,"Rng%",1.2);AddColumn(Vol,"VOL%",1);AddColumn(StochD(14,3),"STO",1);AddColumn(V,"Volume",1);AddColumn(MA(C,10),"10dma",1.2);//AddColumn(result 
= IIf(Green,1,0),"GRN");//AddColumn(result = IIf( Yellow,2,0),"YEL"); 
//AddColumn(result = IIf( Red,3,0),"RED"); AddTextColumn( 
WriteIf(Green,"GRN",WriteIf color = IIf(green, colorGreen, IIf(yellow, 
colorYellow, colorRed)); AddTextColumn( WriteIf(Green,"GRN",WriteIf 
(Yellow,"YEL","RED")),"Stregth Meter");color = IIf(green, colorGreen, 
IIf(yellow, colorYellow, colorRed)); (Yellow,"YEL","RED")),"Strength Meter", 1, 
textColor = colorDefault,color);Send BUG REPORTS to 
bugs@xxxxxxxxxxxxxSend SUGGESTIONS to 
suggest@xxxxxxxxxxxxx-----------------------------------------Post 
AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx(Web page: <A 
href="">http://groups.yahoo.com/group/amiquote/messages/)--------------------------------------------Check 
group FAQ at: <A 
href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.htmlYahoo! 
Groups LinksTo visit your group on the web, go to:  <A 
href="">http://groups.yahoo.com/group/amibroker/To 
unsubscribe from this group, send an email to:  
amibroker-unsubscribe@xxxxxxxxxxxxxxxYour use of Yahoo! Groups is 
subject to:  <A 
href="">http://docs.yahoo.com/info/terms/


Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html





Yahoo! Groups Links
To visit your group on the web, go to:http://groups.yahoo.com/group/amibroker/ 
To unsubscribe from this group, send an email to:amibroker-unsubscribe@xxxxxxxxxxxxxxx 
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.