Home arrow Support arrow C# - Sample3 Code
PDF Print E-mail

Sample3 Code: Shows how to create a program with C#

You can download the sample3 code by Clicking the Link to the Right: Sample3

 

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using QuotesPlus;

namespace Sample3
{
public partial class Form1 : Form
{
Price2Class pp;
Dividends dd;
CompanyInfo cc;
RevEpsClass ep;
EarningsEstimates ee;
AnalystRecsClass ar;

public Form1()
{
InitializeComponent();
}

private void Form1_Load(object sender, EventArgs e)
{
pp = new Price2Class();
dd = new Dividends();
ep = new RevEpsClass();
cc = new CompanyInfo();
ee = new EarningsEstimates();
ar = new AnalystRecsClass();

}

private void button1_Click(object sender, EventArgs e)
{
pp.Symbol = textBox1.Text;
dd.Symbol = textBox1.Text;
ep.Symbol = textBox1.Text;
cc.Symbol = textBox1.Text;
ee.Symbol = textBox1.Text;
ar.Symbol = textBox1.Text;

for (int n = 0; n > -10; n--)
{
DateTime dt;
dt = DateTime.Parse(pp.Date(n).ToString());

textBox3.Text += dt.ToShortDateString();
textBox3.Text += "\t";
textBox3.Text += pp.Open(n).ToString();
textBox3.Text += "\t";
textBox3.Text += pp.High(n).ToString();
textBox3.Text += "\t";
textBox3.Text += pp.Close(n).ToString();
textBox3.Text += "\t ";
textBox3.Text += pp.Volume(n).ToString();
textBox3.Text += "\r\n";
}
for (int n = 0; n > -4; n--)
{
listBox4.Items.Add("ExDate" + "\t" + dd.ExDate(n).ToString());
listBox2.Items.Add("Record Date" + "\t" + dd.RecDate(n).ToString() + "\t" + dd.Amount(n).ToString());
listBox3.Items.Add("Announcement Date" + "\t" + dd.AnnDate(n).ToString());
listBox5.Items.Add("Payable Date" + "\t" + dd.PayDate(n).ToString());
}
for (int n = 0; n > -20; n--)
{
listBox6.Items.Add(ep.QtrDate(n).ToString() + "\t" + ep.Earnings(n).ToString() + "\t" + ep.Revenues(n).ToString());
}

textBox2.Text += "Company - ";
textBox2.Text += cc.Description();
textBox2.Text += "\r\n";
textBox2.Text += "EPS Rank Date - ";
textBox2.Text += cc.EpsRankDate().ToString();
textBox2.Text += "\r\n";
textBox2.Text += "EPS Rank - ";
textBox2.Text += cc.EpsRank().ToString();
textBox2.Text += "\r\n";
textBox2.Text += "Industry - ";
textBox2.Text += cc.Industry().ToString();
textBox2.Text += "\r\n";
textBox2.Text += "EPS Grwth 1Yr - ";
textBox2.Text += cc.EPSGrowth1Yr().ToString();
textBox2.Text += "\r\n";
textBox2.Text += "EPS Grwth 5Yr - ";
textBox2.Text += cc.EPSGrowth5Yr().ToString();

for (int n = 0; n > -1; n--)
{



textBox4.Text += "End Date ";
textBox4.Text += "\t\t";
textBox4.Text += ee.QtrEndDate(n).ToString();
textBox4.Text += "\t";
textBox4.Text += ee.FyEndDate(n).ToString();
textBox4.Text += "\r\n";
textBox4.Text += "# of Analyst Estimates ";
textBox4.Text += "\t";
textBox4.Text += ee.QtrEstimates(n).ToString();
textBox4.Text += "\t";
textBox4.Text += ee.FyEstimates(n).ToString();
textBox4.Text += "\r\n";
textBox4.Text += "Highest Estimates ";
textBox4.Text += "\t";
textBox4.Text += ee.QtrHighEstimate(n).ToString();
textBox4.Text += "\t";
textBox4.Text += ee.FyHighEstimate(n).ToString();
textBox4.Text += "\r\n";
textBox4.Text += "Lowest Estimates ";
textBox4.Text += "\t";
textBox4.Text += ee.QtrLowEstimate(n).ToString();
textBox4.Text += "\t";
textBox4.Text += ee.FyLowEstimate(n).ToString();
textBox4.Text += "\r\n";
textBox4.Text += "Current Mean";
textBox4.Text += "\t\t";
textBox4.Text += ee.QtrMean(n).ToString();
textBox4.Text += "\t";
textBox4.Text += ee.FyMean(n).ToString();
textBox4.Text += "\r\n";
textBox4.Text += "1 Year Ago EPS";
textBox4.Text += "\t\t";
textBox4.Text += ee.QtrYPAEPS(n).ToString();
textBox4.Text += "\t";
textBox4.Text += ee.FyYPAEPS().ToString();
textBox4.Text += "\r\n";
textBox4.Text += "EPS Growth";
textBox4.Text += "\t\t";
textBox4.Text += ee.QtrGrowth(n).ToString() + "%";
textBox4.Text += "\t";
textBox4.Text += ee.FyGrowth(n).ToString() + "%";

textBox5.Text += "Long Term Growth Current Mean: ";
textBox5.Text += "\t\t";
textBox5.Text += ee.LTGMean().ToString();
textBox5.Text += "\r\n";
textBox5.Text += "Number of Long Term Growth Estimates: ";
textBox5.Text += "\t";
textBox5.Text += ee.LTGEstimates().ToString();
textBox5.Text += "\r\n";
textBox5.Text += "Long Term Growth High Estimates: ";
textBox5.Text += "\t\t";
textBox5.Text += ee.LTGHighEstimate().ToString();
textBox5.Text += "\r\n";
textBox5.Text += "Long Term Growth Low Estimates: ";
textBox5.Text += "\t\t";
textBox5.Text += ee.LTGLowEstimate().ToString();
textBox5.Text += "\r\n";
for (int x = 0; x > -4; x--)
{

textBox6.Text += "Current";
textBox6.Text += "\r\n";
textBox6.Text += "1 Month Ago";
textBox6.Text += "\r\n";
textBox6.Text += "2 Months Ago";
textBox6.Text += "\r\n";
textBox6.Text += "3 Months Ago";
textBox6.Text += "\r\n";
textBox6.Text += "\r\n";



listBox7.Items.Add("# of Strong Buys" + "\r\n\t" + ar.StrongBuys(x).ToString() + "\r\n" );
listBox8.Items.Add("# of Mod. Buys" + "\r\n\t" + ar.ModerateBuys(x).ToString() + "\r\n");
listBox9.Items.Add("# of Holds" + "\r\n\t" + ar.Holds(x).ToString() + "\r\n");

textBox7.Text += "Current";
textBox7.Text += "\r\n";
textBox7.Text += "1 Month Ago";
textBox7.Text += "\r\n";
textBox7.Text += "2 Months Ago";
textBox7.Text += "\r\n";
textBox7.Text += "3 Months Ago";
textBox7.Text += "\r\n";
textBox7.Text += "\r\n";

listBox10.Items.Add("# of Mod. Sells" + "\r\n\t" + ar.ModerateSells(x).ToString() + "\r\n");
listBox11.Items.Add("# of Strong Sells" + "\r\n\t" + ar.StrongSells(x).ToString() + "\r\n");
listBox12.Items.Add("Mean Recomm." + "\r\n\t" + ar.Mean(x).ToString() + "\r\n");




}
}




}
}

}
 
< Prev   Next >