PureBytes Links
Trading Reference Links
|
Sure: This goes into a table that has last 4 quarter eps and sales
and plots it in a gridlike fashion in an indicator panel. It always
leaves an open broker.exe
odbcOpenDatabase("DSN=earningsdb");
odbcSetFieldNames("ticker", "datenum" );
coname = odbcGetValue( "selected", "", "company" );
indus = odbcGetValue("selected","","industry");
q1e = odbcGetValue("selected","", "q1e");
q2e = odbcGetValue("selected","","q2e");
q3e = odbcGetValue("selected","","q3e");
q4e = odbcGetValue("selected","","q4e");
q5e = odbcGetValue("selected","","q5e");
q6e = odbcGetValue("selected","","q6e");
q7e = odbcGetValue("selected","","q7e");
q8e = odbcGetValue("selected","","q8e");
s1 = odbcGetValue("selected","","q1s");
s2 = odbcGetValue("selected","","q2s");
s3 = odbcGetValue("selected","","q3s");
s4 = odbcGetValue("selected","","q4s");
s5 = odbcGetValue("selected","","q5s");
s6 = odbcGetValue("selected","","q6s");
s7 = odbcGetValue("selected","","q7s");
s8 = odbcGetValue("selected","","q8s");
float = odbcGetValue("selected","","float");
float = IIf(IsNull(float),0,float);
Coname = odbcGetValue("selected","","company");
CellHeight = 20;
CellWidth = 100;
GfxSelectFont( "Tahoma", CellHeight/2 );
function PrintInCell( string, row, Col )
{
GfxDrawText( string, Col * CellWidth, row * CellHeight, (Col + 1 ) *
CellWidth, (row + 1 ) * CellHeight, 0 );
}
PrintInCell( "Earnings", 0, 1 );
PrintInCell( "Earnings", 0, 2 );
PrintInCell( "Earn%", 0, 3 );
PrintInCell( "Sales", 0, 4 );
PrintInCell( "Sales", 0, 5 );
PrintInCell( "Sales %", 0, 6 );
PrintInCell(NumToStr(q4e), 1, 1 );
PrintInCell(NumToStr(q3e), 2, 1 );
PrintInCell(NumToStr(q2e), 3, 1 );
PrintInCell(NumToStr(q1e), 4, 1 );
PrintInCell(NumToStr(q8e), 1, 2 );
PrintInCell(NumToStr(q7e), 2, 2 );
PrintInCell(NumToStr(q6e), 3, 2 );
PrintInCell(NumToStr(q5e), 4, 2 );
Chg = ((q4e/(q8e+.01))*100)-100;
thiscol = IIf(Chg > 50,colorYellow,colorWhite);
thiscol = IIf(Chg > 100,colorGreen,thiscol);
GfxSetBkColor( thiscol );
PrintInCell(NumToStr(Chg), 1, 3 );
Chg = ((q3e/(q7e+.01))*100)-100;
thiscol = IIf(Chg > 50,colorYellow,colorWhite);
thiscol = IIf(Chg > 100,colorGreen,thiscol);
GfxSetBkColor( thiscol );
PrintInCell(NumToStr(Chg), 2, 3 );
Chg =( (q2e/(q6e+.01))*100)-100;
thiscol = IIf(Chg > 50,colorYellow,colorWhite);
thiscol = IIf(Chg > 100,colorGreen,thiscol);
GfxSetBkColor( thiscol );
PrintInCell(NumToStr(Chg), 3, 3 );
Chg = ((q1e/(q5e+.01))*100)-100;
thiscol = IIf(Chg > 50,colorYellow,colorWhite);
thiscol = IIf(Chg > 100,colorGreen,thiscol);
GfxSetBkColor( thiscol );
PrintInCell(NumToStr(Chg), 4, 3 );
GfxSetBkColor(colorWhite );
PrintInCell(NumToStr(s4), 1, 4 );
PrintInCell(NumToStr(s3), 2, 4 );
PrintInCell(NumToStr(s2), 3, 4 );
PrintInCell(NumToStr(s1), 4, 4 );
PrintInCell(NumToStr(s8), 1, 5 );
PrintInCell(NumToStr(s7), 2, 5 );
PrintInCell(NumToStr(s6), 3, 5 );
PrintInCell(NumToStr(s5), 4, 5 );
GfxSetBkColor( thiscol );
PrintInCell(NumToStr(Chg), 1, 6 );
Chg =( (s4/(s8+.01))*100)-100;
thiscol = IIf(Chg > 25,colorYellow,colorWhite);
thiscol = IIf(Chg > 50,colorGreen,thiscol);
GfxSetBkColor( thiscol );
PrintInCell(NumToStr(Chg), 2, 6 );
Chg = ((s3/(s7+.01))*100)-100;
thiscol = IIf(Chg > 25,colorGreen,colorWhite);
thiscol = IIf(Chg > 50,colorGreen,thiscol);
GfxSetBkColor( thiscol );
PrintInCell(NumToStr(Chg), 3, 6 );
Chg = ((s2/(s6+.01))*100)-100;
thiscol = IIf(Chg > 25,colorGreen,colorWhite);
thiscol = IIf(Chg > 50,colorGreen,thiscol);
GfxSetBkColor( thiscol );
PrintInCell(NumToStr(Chg), 4, 6 );
Chg = ((s1/(s5+.01))*100)-100;
thiscol = IIf(Chg > 25,colorGreen,colorWhite);
thiscol = IIf(Chg > 50,colorGreen,thiscol);
--- In amibroker@xxxxxxxxxxxxxxx, "dingo" <dingo@xxx> wrote:
>
> Its prolly caused by your indicator code - how about posting the
part that
> deals with SQL?
>
> d
>
> > -----Original Message-----
> > From: amibroker@xxxxxxxxxxxxxxx
> > [mailto:amibroker@xxxxxxxxxxxxxxx] On Behalf Of Mike
> > Sent: Tuesday, October 16, 2007 3:30 PM
> > To: amibroker@xxxxxxxxxxxxxxx
> > Subject: [amibroker] Re: I get multiple brokers all the time
> > without any code
> >
> > I have get multiple broker.exe all the time without code. Seems to
> > come when I add an indicator that calls an external database through
> > the sql commands. I reported it twice to tech support but they
> > never got back to me so I just go and check from time to time for the
> > extra broker.exe and stop them from running as a work-around for now.
> >
> >
> >
> > Please note that this group is for discussion between users only.
> >
> > To get support from AmiBroker please send an e-mail directly to
> > SUPPORT {at} amibroker.com
> >
> > For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
> > http://www.amibroker.com/devlog/
> >
> > For other support material please check also:
> > http://www.amibroker.com/support.html
> >
> > Yahoo! Groups Links
> >
> >
> >
> >
>
Please note that this group is for discussion between users only.
To get support from AmiBroker please send an e-mail directly to
SUPPORT {at} amibroker.com
For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/
For other support material please check also:
http://www.amibroker.com/support.html
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/amibroker/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/amibroker/join
(Yahoo! ID required)
<*> To change settings via email:
mailto:amibroker-digest@xxxxxxxxxxxxxxx
mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx
<*> 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/
|