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

[amibroker] Re: Is it possible to run visual basic code from AB?


  • Date: Sun, 14 Feb 2010 01:30:32 -0000
  • From: "polomorabe" <polomora@xxxxxxxxx>
  • Subject: [amibroker] Re: Is it possible to run visual basic code from AB?

PureBytes Links

Trading Reference Links

Thanks for the reply.

Sorry to show my ignorance, but what is the difference? Are you saying that something like this can't be done?

With the benefit of lots of plagiarism and some amount of effort, I managed to get this code working for Excel. Is there no way to get something working with AB / VBScript?

--- In amibroker@xxxxxxxxxxxxxxx, Fred Tonetti <ftonetti@xxx> wrote:
>
> You're writing VB instead of VBScript which is what was "enabled" .
> 
>  
> 
>   _____  
> 
> From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] On Behalf
> Of polomorabe
> Sent: Saturday, February 13, 2010 12:55 PM
> To: amibroker@xxxxxxxxxxxxxxx
> Subject: [amibroker] Re: Is it possible to run visual basic code from AB?
> 
>  
> 
>   
> 
> Hello Mike,
> 
> I tried it, and it doesn't work. I get an error at the first DIM declaration
> 
> Dim sPage As Variant
> "Expected end of statement Source: Microsoft VBScript compilation error"
> with the cursor sitting just before the "As" keyword.
> 
> Can you help? Sounds like I am doing something silly...
> 
> Thanks,
> Paul
> 
> Here is my AFL / VBscript:
> 
> EnableScript("vbscript");
> 
> ticker = Name();
> 
> <%
> Dim sPage As Variant
> Dim iGBP As Variant, iDec As Variant
> Dim iStart As Variant, iEnd As Variant
> Dim dRate As Variant
> Dim earningsURL As Variant
> Dim datedebug As Variant
> 
> earningsURL = ""http://www.zacks.
> <http://www.zacks.com/research/report.php?type=estimates&t=>
> com/research/report.php?type=estimates&t=""AFL("ticker")""&x=0&y=0"""
> Set OIE1 = New SHDocVw.InternetExplorer
> OIE1.Navigate earningsURL
> do Until OIE1.ReadyState = READYSTATE_COMPLETE
> DoEvents
> Loop
> 
> sPage = OIE1.Document.body.InnerHTML
> OIE1.Quit
> Set OIE1 = Nothing
> On Error GoTo DUMMYDATA
> iGBP = InStr(1, sPage, "Next Report Date") '+ 12
> On Error GoTo DUMMYDATA
> iDec = InStr(iGBP, sPage, "&")
> iStart = InStrRev(sPage, "align=right>", iDec) + 12
> iEnd = InStr(iDec, sPage, "/") - 34
> datedebug = Mid(sPage, iStart, iEnd - iStart)
> if IsDate(datedebug) 
> Then
> dRate = datedebug
> else: 
> dRate = "=TODAY()+(100)"
> End if
> Goto END
> 
> DUMMYDATA:
> dRate = "=TODAY()+(100)"
> dRate = Empty
> 
> END:
> AFL.Var("earningdate") = dRate
> %>
> 
> --- In amibroker@xxxxxxxxx <mailto:amibroker%40yahoogroups.com> ps.com,
> "Mike" <sfclimbers@> wrote:
> >
> > You can embed scripting directly into your AFL and exchange variable
> values between the two as desired:
> > 
> > http://www.amibroke <http://www.amibroker.com/guide/a_aflcom.html>
> r.com/guide/a_aflcom.html
> > 
> > Additional examples using VBScript:
> > 
> > http://www.amibroke <http://www.amibroker.com/guide/a_script.html>
> r.com/guide/a_script.html
> > 
> > Mike
> > 
> > --- In amibroker@xxxxxxxxx <mailto:amibroker%40yahoogroups.com> ps.com,
> "polomorabe" <polomora@> wrote:
> > >
> > > I don't know if this is a stupid question.
> > > 
> > > I have written a VB macro to scrape the Zachs web page to extract the
> next earnings date, and paste it into an Excel worksheet cell. Is it
> possible to do somehow execute VB from within AB, to get the same
> information?
> > > 
> > > http://www.zacks.
> <http://www.zacks.com/research/report.php?type=estimates&t=IBM&x=0&y=0>
> com/research/report.php?type=estimates&t=IBM&x=0&y=0
> > > 
> > > Many thanks,
> > > Paul
> > >
> >
>




------------------------------------

**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

TO GET TECHNICAL SUPPORT send an e-mail directly to 
SUPPORT {at} amibroker.com

TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

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:
    amibroker-digest@xxxxxxxxxxxxxxx 
    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/