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

RE: TJ - Re: [amibroker] Sector Rotation ... Finally - VBscript: HELP



PureBytes Links

Trading Reference Links




If 
you're still having problems with this try assigning to a variable first and 
then to the array.
<FONT face=Tahoma color=#0000ff 
size=2> 
<FONT face=Tahoma color=#0000ff 
size=2>   tmpVariable = <FONT face=Arial 
color=#000000>cint(Left(strLine,1))
<FONT 
face=Arial color=#000000>   <FONT 
face=Arial>arrBuyArray(intSize) 
=   <FONT face=Tahoma 
color=#0000ff>tmpVariable    
<FONT face=Arial 
size=2> 
<FONT face=Arial 
size=2> 
Here's something 
else to try:
<FONT face=Arial 
size=2> 
Do 
While objFile.AtEndOfStream = False   strLine = 
objFile.ReadLine   strArray = strArray &  Left( strLine 
,1) & "," LoopstrArray = left$(strArray, len(strArray) -1) ' get rid 
of that last ","arrBuyArray = array(strArray)
<FONT face=Arial 
size=2> 

  
  <FONT 
  face=Tahoma size=2>-----Original Message-----From: Ara Kaloustian 
  [mailto:ara1@xxxxxxxxxx] Sent: Tuesday, February 11, 2003 10:49 
  AMTo: amibroker@xxxxxxxxxxxxxxxSubject: TJ - Re: 
  [amibroker] Sector Rotation ... Finally - VBscript: HELP
  d 
   
  Thanks for the suggestion .... still have same 
  problem
   
  I tried converting the VBS read strLine before 
  passing array back to AFL to:
   
  <FONT 
  face=Arial>arrBuyArray(intSize) = 
  Left(strLine,1)              
  - Remove any CntFeed characters
  <FONT 
  face=Arial>arrBuyArray(intSize) = 
  Cint(strLine)                
  - Convert to integer
  <FONT 
  face=Arial>arrBuyArray(intSize) = 
  Cint(Left(strLine,1))      - 
  Convert to integer after removing CntFeed
   
  No luck... AFL still gives "Mismatch - Assignment 
  failed" error 
   
  Hope TJ sees this.... 
   
  Ara 
  <BLOCKQUOTE 
  >
    ----- Original Message ----- 
    <DIV 
    >From: 
    dingo 
    To: <A title=amibroker@xxxxxxxxxxxxxxx 
    href="">amibroker@xxxxxxxxxxxxxxx 
    Sent: Tuesday, February 11, 2003 7:00 
    AM
    Subject: RE: [amibroker] Sector 
    Rotation ... Finally - VBscript: HELP
    
    <FONT face=Tahoma color=#0000ff 
    size=2>The only thing I can think of is that if there is a crlf at the end 
    of each line that you're putting them in as well as the 1 or 0.  Try 
    this:
    <FONT face=Tahoma color=#0000ff 
    size=2> 
    <FONT 
    size=2>arrBuyArray(intSize) = <FONT 
    face=Tahoma color=#0000ff> Left( strLine<SPAN 
    class=688285814-11022003><FONT face=Tahoma 
    color=#0000ff> ,1) 
    <FONT face=Tahoma 
    color=#0000ff size=2><SPAN 
    class=688285814-11022003> 
    <FONT face=Tahoma 
    color=#0000ff size=2>This assumes that you 
    have a 1 or 0 in each line. If a line contains something other than 1 or 0 
    or is missing either you'll need to allow for 
    that.
    <FONT face=Tahoma 
    color=#0000ff size=2><SPAN 
    class=688285814-11022003> 
    <FONT face=Tahoma 
    color=#0000ff size=2>Hope this gets you 
    going.
    <FONT face=Tahoma 
    color=#0000ff size=2><SPAN 
    class=688285814-11022003> 
    <FONT face=Tahoma 
    color=#0000ff size=2><SPAN 
    class=688285814-11022003>d
    
      
      <FONT 
      face=Tahoma size=2>-----Original Message-----From: Ara 
      Kaloustian [mailto:ara1@xxxxxxxxxx] Sent: Tuesday, February 11, 
      2003 9:49 AMTo: amibroker@xxxxxxxxxxxxxxxSubject: 
      Re: [amibroker] Sector Rotation ... Finally - VBscript: 
      HELP
      d
       
      The buy / sell file is one character per 
      line:  
                    
      objBuyFile.WriteLine 1
       
      Reading back: 
      intSize = 0Do While objFile.AtEndOfStream 
      = False   strLine = objFile.ReadLine
       
         ReDim Preserve 
      ArrBuyArray(intSize)   arrBuyArray(intSize) = 
      strLine   intSize = 
      intSize+1LoopobjFile.Close
       
      Transfer back to 
      AFL:        AFL("BuyArray") = 
      arrBuyArray  
       
      So the final presentation to AFL should be 
      101010 type sequence
       
      Thanks
       
      Ara
      <BLOCKQUOTE 
      >
        ----- Original Message ----- 
        <DIV 
        >From: 
        dingo 

        To: <A 
        title=amibroker@xxxxxxxxxxxxxxx 
        href="">amibroker@xxxxxxxxxxxxxxx 
        
        Sent: Tuesday, February 11, 2003 
        6:03 AM
        Subject: RE: [amibroker] Sector 
        Rotation ... Finally - VBscript: HELP
        
        <FONT face=Tahoma color=#0000ff 
        size=2>How did you write the file out to disk? IOW is it jut 
        1010010  or did you separate them with commas?
        <FONT face=Tahoma color=#0000ff 
        size=2> 
        <FONT face=Tahoma color=#0000ff 
        size=2>You need to know that in order to load the 
        array's..
        <FONT face=Tahoma color=#0000ff 
        size=2> 
        <FONT face=Tahoma color=#0000ff 
        size=2>d
        
          
          <FONT 
          face=Tahoma size=2>-----Original Message-----From: Ara 
          Kaloustian [mailto:ara1@xxxxxxxxxx] Sent: Tuesday, February 
          11, 2003 12:54 AMTo: AmiBroker - BBSubject: 
          [amibroker] Sector Rotation ... Finally - VBscript: 
          HELP
          We're almost there...
           
          Completed code in 3 
sections:
          1. Export data files from AFL to VBS to 
          disk
          2. Data processing - process data and 
          create buy / sell arrays
          3. Import processed Buy / Sell arrays 
          back to AFL
           
          Current problem interfacing with 
          AFL...
           
          The Buy Sell arrays are VBS  files 
          with "1" and "0" read into arrays to send back to AFL
           
          When I bring them back, I get AFL error 
          saying "Missmatch,  Assignment Failed. One message for each array 
          transferred back.
           
          Anyone with suggestions?
           
          Thanks
           
          Ara
           
          
          //File - DEV - Sector Rotation #3 - VB to AFL<FONT 
          size=1>
           
           
          Ticker = Name<FONT 
          size=1>();
          EnableScript(<FONT color=#ff00ff 
          size=1>"vbscript");
          <%
          VBS code ..... to read disk file
          
          AFL("BuyArray"<FONT 
          size=1>) = arrBuyArray '* Transfer array back to AFL 
          AFL("SellArray"<FONT 
          size=1>)= ArrSellArray
          %>
          BuyPrice = Close;
          SellPrice = Close;
          Buy = BuyArray;
          Sell= SellArray;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 
          Your use of Yahoo! Groups is subject to the <A 
          href="">Yahoo! Terms of 
          Service. 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 
        Your use of Yahoo! Groups is subject to the <A 
        href="">Yahoo! Terms of 
        Service. 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 
      Your use of Yahoo! Groups is subject to the <A 
      href="">Yahoo! Terms of Service. 
      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 
    Your use of Yahoo! Groups is subject to the <A 
    href="">Yahoo! Terms of Service. 
    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 
  Your use of Yahoo! Groups is subject to the <A 
  href="">Yahoo! Terms of Service. 







Yahoo! Groups Sponsor


  ADVERTISEMENT  









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



Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.