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

[amibroker] amibroker as a database to asp application



PureBytes Links

Trading Reference Links




<FONT face=Verdana 
size=2>Hi,
<FONT face=Verdana 
size=2> 
This is a 
brute force method of programmatically starting AmiBroker using Visual 
Basic and a windows shortcut, if you are using vbscript you will have to adapt 
to suit. 
First create a 
windows shortcut to AmiBroker (or use the existing shortcut) and place 
it somewhere on your hard drive then set the path in the code below. Once 
AmiBroker is open using this method you will be able to use OLE 
Automation.
<FONT face=Verdana 
size=2> 
<FONT 
color=#008000>'Place this API function in general declarations section of main 
form or make public and put in module.Private Declare Function 
ShellExecute Lib "Shell32.dll" Alias "ShellExecuteA" ( _    
ByVal hwnd As Long, _    ByVal lpOperation As String, 
_    ByVal lpFile As String, _    ByVal 
lpParameters As String, _    ByVal lpDirectory As String, 
_    ByVal nShowCmd As Long _) As 
Long
<FONT face=Verdana 
size=2>'Paste this sub procedure in main 
form.
Sub DoWaitEvents(msWait As Long)Dim msEnd As 
Long    msEnd = GetTickCount + msWait    
Do        DoEvents    
Loop While GetTickCount < msEndEnd Sub
 
 
<FONT 
color=#008000>'Paste the following code into the 
load event of the main form or
<SPAN 
class=390462220-19042004><FONT 
color=#008000>'where ever suitiable for your 
application. Set the path to your AmiBroker
<SPAN 
class=390462220-19042004>'Windows shortcut.
<SPAN 
class=390462220-19042004>Dim PathToShortcut As 
String
 
'Set this to the path 
of valid shortcut linkPathToShortcut = 
"C:\AmiBroker.lnk"
 
ShellExecute 0&, vbNullString, 
PathToShortcut, vbNullString, vbNullString, &O1
 
'Wait<SPAN 
class=390462220-19042004> time<SPAN 
class=390462220-19042004> (milliseconds) for AmiBroker to<SPAN 
class=390462220-19042004> finish open<SPAN 
class=390462220-19042004>ing. If you find AmiBroker opens slowly then 
you'may have to increase the wait time. 
AMiBroker should be fully open and finshed 
executing
<SPAN 
class=390462220-19042004><FONT 
size=2>'b<SPAN 
class=390462220-19042004>efore making 
anyDoWaitEvents 
1000
 
 

Regards,William Peters<A 
href=""><FONT 
size=2>www.amitools.com
<FONT face=Tahoma 
size=2>-----Original Message-----From: RR 
[mailto:stocks@xxxxxxxxxxxxx]Sent: April Monday 19, 2004 11:47 
AMTo: amibroker@xxxxxxxxxxxxxxxSubject: RE: [amibroker] 
Automation of Amibroker
<FONT face=Arial color=#0000ff 
size=2>Several reasons including but not limited to:
<FONT face=Arial color=#0000ff 
size=2> 
<FONT face=Arial color=#0000ff 
size=2>1)  There could be an installation problem related to OLE 
Automation
<FONT face=Arial color=#0000ff 
size=2>2)  I have several scripts that I am wanting to batch which may 
require different databases
<FONT face=Arial color=#0000ff 
size=2>3)  It should work in this manner as I do not need to have Excel 
executing in stand-alone mode to use Excel objects
<BLOCKQUOTE 
>
  <FONT face="Times New Roman" 
  size=2>-----Original Message-----From: dingo 
  [mailto:dingo@xxxxxxxxxxxx]Sent: Monday, April 19, 2004 10:30 
  AMTo: amibroker@xxxxxxxxxxxxxxxSubject: RE: [amibroker] 
  Automation of Amibroker
  <FONT face=Arial 
  color=#0000ff size=2>You seem to be determined to do it this way so you'll 
  have to find out on your own as I don't really know for sure what's set and 
  what's not set. 
  <FONT face=Arial 
  color=#0000ff size=2> 
  <FONT face=Arial 
  color=#0000ff size=2>Mind telling me why?
  <FONT face=Arial 
  color=#0000ff size=2> 
  <FONT face=Arial 
  color=#0000ff size=2>d
  
    
    
    From: RR [mailto:stocks@xxxxxxxxxxxxx] 
    Sent: Monday, April 19, 2004 11:26 AMTo: 
    amibroker@xxxxxxxxxxxxxxxSubject: RE: [amibroker] Automation of 
    Amibroker
    
    <FONT face=Arial color=#0000ff 
    size=2>Adding the code to load the database does give securities that are 
    processed.  The _TRACE(DESC) functionality 
    <FONT face=Arial color=#0000ff 
    size=2>does NOT display any of the securities being processed although 
    you can see them in AA.  Adding the AB.Quit() method appears to remove 
    the broker.exe module 
    <FONT face=Arial color=#0000ff 
    size=2>from memory.  Any other settings need to be loaded to get this 
    to work in stand-alone mode?  I have noticed the toolbar settings are 
    
    <FONT face=Arial color=#0000ff 
    size=2>changed when executing the script and then going back into Amibroker 
    from what they were before executing the script.
    <FONT face=Arial color=#0000ff 
    size=2> 
    <FONT face=Arial color=#0000ff 
    size=2>Thanks,
    <FONT face=Arial color=#0000ff 
    size=2> 
    <FONT face=Arial color=#0000ff 
    size=2> 
    <FONT face=Arial color=#0000ff 
    size=2>RRSend 
  BUG REPORTS to bugs@xxxxxxxxxxxxxSend SUGGESTIONS to 
  suggest@xxxxxxxxxxxxx-----------------------------------------Post 
  AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx (Web page: <A 
  href="">http://groups.yahoo.com/group/amiquote/messages/)--------------------------------------------Check 
  group FAQ at: <A 
  href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
  Send BUG REPORTS to bugs@xxxxxxxxxxxxxSend 
  SUGGESTIONS to 
  suggest@xxxxxxxxxxxxx-----------------------------------------Post 
  AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx (Web page: <A 
  href="">http://groups.yahoo.com/group/amiquote/messages/)--------------------------------------------Check 
  group FAQ at: <A 
  href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
  


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 the Yahoo! Terms of Service.