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

RE: [amibroker] Re: how to? with script, download data from web



PureBytes Links

Trading Reference Links




<FONT face=Arial 
color=#0000ff size=2>I sent you a private email but haven't heard back. 
Meanwhile here's a sample VBScript that will take whatever command line params 
you pass it and create a text file containing same.  Look at the comments 
to see where you need to modify the code.
<FONT face=Arial 
color=#0000ff size=2> 
<FONT face=Arial 
color=#0000ff size=2>Copy and paste the lines below in to a text editor and save 
it in the directory you want it run and make the file extension .VBS. 

<FONT face=Arial 
color=#0000ff size=2> 
<FONT face=Arial 
color=#0000ff 
size=2>--------------------8<---------------------------------------------------
<FONT 
color=#0000ff> 
<FONT face="Courier New" 
color=#0000ff 
size=1>'*********************************************'Purpose:   
This script will take the 
command'           line 
parameters passed to 
it'           and write 
them out to a 
text'           
file.''Created By: 
dingo'*********************************************
 
<FONT face="Courier New" 
color=#0000ff size=1>Dim oWSHDim oArgsDim oFSODim 
oFile
 
<FONT face="Courier New" 
color=#0000ff size=1>Dim iDim iResultDim sText
 
<FONT face="Courier New" 
color=#0000ff 
size=1>'!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!' change the 
following to suit your 
application'!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!Const 
cstPathForAlertFile = "C:\Program Files\Amibroker\Alert.txt"Const 
cstScriptName = "Your Script Name Here"
 
<FONT face="Courier New" 
color=#0000ff size=1>'------------------------------------------' declare 
objects for the Shell and the ' Arguments (command line 
params)'------------------------------------------Set oWSH = 
WScript.CreateObject("WScript.Shell")Set oArgs = 
WScript.Arguments
 
<FONT face="Courier New" 
color=#0000ff size=1>If oArgs.Count > 0 Then    
'------------------------------------------    ' If more than 
one argument is passed then    ' conctatenate them separated 
by a space    
'------------------------------------------    For i = 0 To 
oArgs.Count - 1        sText = sText 
& oArgs.Item(i) & " "    Next    
'------------------------------------------    ' declare 
objects for the File System    ' Object and Text File then 
create the file    ' and write the string to 
it    
'------------------------------------------    Set oFSO = 
CreateObject("Scripting.FileSystemObject")     Set oFile= 
oFSO.CreateTextFile(cstPathForAlertFile, True)     
oFile.WriteLine sText    oFile.Close  
    iResult = oWSH.popup("Alert File Created", 3, 
cstScriptName, 64)Else    iResult = oWSH.popup("No 
Command Line Params Passed!" & vbCrlf & "Alert File NOT 
Created",,cstScriptName, 16)End If    
 
<FONT face="Courier New" 
color=#0000ff size=1>'------------------------------------------' destroy 
all objects'------------------------------------------set oFile = 
NothingSet oFSO  = NothingSet oArgs = NothingSet oWSH  = 
Nothing
 
<FONT face=Arial 
color=#0000ff size=2> 

  
  
  From: dingo [mailto:waledingo@xxxxxxxxxxx] 
  On Behalf Of dingoSent: Saturday, May 15, 2004 10:38 
  PMTo: amibroker@xxxxxxxxxxxxxxxSubject: RE: [amibroker] 
  AFL Alertif - dingo
  
  <FONT face=Arial 
  color=#0000ff size=2>Will do .. stay tuned.
  <FONT face=Arial 
  color=#0000ff size=2> 
  <FONT face=Arial 
  color=#0000ff size=2>d
  
    
    
    From: Ara Kaloustian 
    [mailto:ara1@xxxxxxxxxx] Sent: Saturday, May 15, 2004 10:13 
    PMTo: amibroker@xxxxxxxxxxxxxxxSubject: Re: 
    [amibroker] AFL Alertif - dingo
    
    Fantastic, I would greatly appreciate 
    that
     
    Ara
    <BLOCKQUOTE 
    >
      ----- Original Message ----- 
      <DIV 
      >From: 
      dingo 
      
      To: <A 
      title=amibroker@xxxxxxxxxxxxxxx 
      href="">amibroker@xxxxxxxxxxxxxxx 
      
      Sent: Saturday, May 15, 2004 11:33 
      AM
      Subject: RE: [amibroker] AFL 
      Alertif
      
      <FONT face=Arial 
      color=#0000ff size=2>Ara,
      <FONT face=Arial 
      color=#0000ff size=2> 
      <FONT face=Arial 
      color=#0000ff size=2>
      <FONT face=Arial 
      color=#0000ff size=2>If you'd like I could write that script for 
      you.
      <FONT face=Arial 
      color=#0000ff size=2> 
      <FONT face=Arial 
      color=#0000ff size=2>d
      
        
        
        From: Tomasz Janeczko 
        [mailto:amibroker@xxxxxx] Sent: Saturday, May 15, 2004 2:20 
        PMTo: <A 
        href="">amibroker@xxxxxxxxxxxxxxxSubject: 
        Re: [amibroker] AFL Alertif
        
        Hello,
         
        You would write an executable (or script) 
        that will write to the file.
         
        Such executable can be used with 
        EXEC:
         
        AlertIf( Stoc_Buy, "<FONT 
        face="Courier New" color=#008000 size=1>EXEC<FONT color=#008000 
        size=1> YourScriptThatCreatesFileAndWritesToIt.JS","Buy " + Name() + "@" 
        + Close, 1, 15, 1 );  ???
        Best regards,Tomasz Janeczkoamibroker.com
        <BLOCKQUOTE 
        >
          ----- Original Message ----- 
          <DIV 
          >From: 
          Ara 
          Kaloustian 
          To: <A 
          title=amibroker@xxxxxxxxxxxxxxx 
          href="">Ami-Main 
          Sent: Thursday, May 13, 2004 8:53 
          PM
          Subject: [amibroker] AFL 
          Alertif
          
          Does anyone know if Alertif can be used 
          to write alerts into a NOTEPAD file.
           
          What would be the command structure with 
          Alertif?
           
          
          AlertIf( Stoc_Buy, "<FONT face="Courier New" color=#008000 
          size=1>EXEC 
          C:\WINNT\system32\notepad.exe","Buy " + Name() + "@" + Close, 1, 15, 1 
          );  ???
          Filename 
          someplace in there?
          <FONT color=#000000 
          size=2> 
          <FONT color=#000000 
          size=2>Thanks
          <FONT color=#000000 
          size=2> 
          <FONT color=#000000 
          size=2>AraSend 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@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@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 Sponsor


  ADVERTISEMENT 












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.