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

RE: [amibroker] US stock Template



PureBytes Links

Trading Reference Links

HI,

 

What I’ve done is this:

 

Do this: http://www.amibroker.com/docs/ab305.html

 

Once the DB is populated,

 

Make sure AB is running and run the attached exe to clean your DB (you need Visual Basic 6.0 runtimes installed which is available at http://www.microsoft.com/downloads/details.aspx?FamilyId=7B9BA261-7A9C-43E7-9117-F673077FFB3C&displaylang=en).  That exe will delete any symbols that have not been updated in the last 30 days or that have no data at all…

 

If you do not trust running exe on your system, create a VBS with this code (exactly the same as included in the exe).

 

 

Option Explicit

 

Private Sub Command1_Click()

Dim AmiBroker

Dim Stock

Dim lngCount As Long

 

  On Error GoTo ErrorHandler

 

  '/* Create AmiBroker app object */

  Screen.MousePointer = vbHourglass

  Set AmiBroker = CreateObject("Broker.Application")

  For Each Stock In AmiBroker.stocks

    If Stock.Quotations.Count = 0 Then

      AmiBroker.stocks.Remove (Stock.Ticker)

      'AmiBroker.RefreshAll

      'txtTSymbol.Text = txtTSymbol.Text & Stock.Ticker & vbCrLf

    ElseIf ToOld(Stock.Quotations) Then

      AmiBroker.stocks.Remove (Stock.Ticker)

      'AmiBroker.RefreshAll

      'txtTSymbol.Text = txtTSymbol.Text & Stock.Ticker & vbCrLf

    End If

    DoEvents

  Next

  Screen.MousePointer = vbDefault

  '/* refresh ticker list and windows */

  AmiBroker.RefreshAll

 

  MsgBox "DONE!  You've cleaned " & lngCount & " symbols."

Exit Sub

ErrorHandler:

  On Error Resume Next

  MsgBox "Error Running Clean up on stock : " & Stock.Ticker

End Sub

 

Private Function ToOld(Quotations As Variant) As Boolean

Dim i As Long

 

  If DateDiff("d", Quotations(Quotations.Count - 1).Date, Now) > 30 Then

    ToOld = True

  End If

End Function

 

Private Function ToOld(Quotations As Variant) As Boolean

Dim i As Long

 

  If DateDiff("d", Quotations(Quotations.Count - 1).Date, Now) > 30 Then

    ToOld = True

  End If

End Function

 

 

 

You will end up with a database with 6300 symbols all categorized properly!!!!

 

Francois

 

 

 


From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] On Behalf Of Anthony Faragasso
Sent: Wednesday, August 31, 2005 9:49 PM
To: amibroker@xxxxxxxxxxxxxxx
Subject: Re: [amibroker] US stock Template

 

Thank you Graham..

 

Anthony

----- Original Message -----

From: Graham

Sent: Wednesday, August 31, 2005 8:21 PM

Subject: Re: [amibroker] US stock Template

 

I have one but have not updated for a while, see if I can do this
today ot tomorrow

http://e-wire.net.au/~eb_kavan/kavemantrading_files/page0002.htm

--
Cheers
Graham
AB-Write >< Professional AFL Writing Service
Yes, I write AFL code to your requirements
http://e-wire.net.au/~eb_kavan/ab_write.htm

On 9/1/05, mrdavis9 <mrdavis9@xxxxxxxxxx> wrote:
> I wish for this every day.  Maybe Dingo has the necessary skills to to this.
> Ron D   ('~')
> ----- Original Message -----
> From: "ajf1111us2000" <ajf1111@xxxxxxxx>
> To: <amibroker@xxxxxxxxxxxxxxx>
> Sent: Wednesday, August 31, 2005 6:47 PM
> Subject: [amibroker] US stock Template
>
>
> > The US stock template is outdated....Has anyone been able to develope
> > a script that could be used to update this template....remove obsolete
> > tickers and update with current tickers/industries/sector settings ?
> >
> >
> > Thank you
> > Anthony
> >
> >
> >
> >
> >
> > 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 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 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 other support material please check also:
http://www.amibroker.com/support.html





YAHOO! GROUPS LINKS




Attachment: ABAutomation.zip
Description: Zip compressed data