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

Re: [amibroker] Graham- please check code



PureBytes Links

Trading Reference Links

Is this what you are trying to do.

//Program

Range = (Close-Low)/(High-Low)*100;

Vol = (V/MA(V,30))*100;

//Strength Meter

Green = 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 AND

RSI( 14 )>70 AND

ADX(14)>30 AND

MA(V,30)>100000 AND

V>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",1,colorDefault,color); //adjusted this

//color = IIf(green, colorGreen, IIf(yellow, colorYellow, colorRed));

//(Yellow,"YEL","RED")),"Strength Meter", 1, textColor = colorDefault,

//color);

----- Original Message ----- 
From: "mroman59" <mroman59@xxxxxxxxx>
To: <amibroker@xxxxxxxxxxxxxxx>
Sent: Monday, December 29, 2003 8:18 PM
Subject: [amibroker] Graham- please check code


> Hello Graham
>
> The other day I posted and you replyed concerning my code question
> in AB. I spoke to early when I said that the code you gave me was
> working correctly. I am having sum bugs in the program and would
> like to know if you could take a look at it?  The only problem right
> now is that any stock that fills the criteria for the "Red" variable
> is not showing up as the color red in the Strength Meter column.
> The colors greeen and yellow work however.  I varified the colors
> with 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 column
> but the stocks with a 3 are not showing up as a red color. The
> following code is part of my program and you may have to chage the
> criteria for "Buy" to generate stocks with the value of 3 to see
> what I am talking about. I have tried various variations of the
> WriteIF statement, but with no luck. Your help is appreciated, MR
>
>
> //Program
>
> Range = (Close-Low)/(High-Low)*100;
> Vol = (V/MA(V,30))*100;
>
> //Strength Meter
> Green = 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 AND
> RSI( 14 )>70 AND
> ADX(14)>30 AND
> MA(V,30)>100000 AND
> V>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@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:
>  http://docs.yahoo.com/info/terms/
>
>


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.556 / Virus Database: 348 - Release Date: 12/26/2003


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 Sponsor ---------------------~-->
Buy Ink Cartridges or Refill Kits for your HP, Epson, Canon or Lexmark
Printer at MyInks.com. Free s/h on orders $50 or more to the US & Canada.
http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/mOAaAA/3exGAA/qnsNAA/GHeqlB/TM
---------------------------------------------------------------------~->

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:
 http://docs.yahoo.com/info/terms/