Announcement

Collapse
No announcement yet.

limit on number of output files ?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • limit on number of output files ?

    I have an EFS that generates 7 output files but I can only get one output file at a time and I need to run the same EFS for once for each and every subsequent output files. Which by itself is rather strage behavior as if the execution of EFS is somehow suspended, is there a limit on number of output files generated simultaneously by an EFS ?
    Thanks,
    Hiromichi
    Last edited by hiromichi; 09-14-2007, 09:36 PM.

  • #2
    This is what I use for file output. I hope it helps you out..

    function fWriteAuditTrail(vText) {
    // debugPrintln("[T "+Current_Control+" "+getSymbol()+"-"+nRTTimeMin+"] *
    Audit Trail * ");
    var f = new File(AuditTrailFile);
    f.open("at");
    f.write(vtDate+" "+vText+"\n");

    f.close();

    }

    function fWriteCSVFile(vText, Amount) {

    var f = new File(CSVFile);
    f.open("at");
    if ((Amount == 0) && (vText[0] == "R")) {
    f.write(vtDate+","+nRTTimeMin+","+getSymbol()+",0, "+Amount+","+vText
    +" \n");
    } else if (Amount >= 0) {
    f.write(vtDate+","+nRTTimeMin+","+getSymbol()+",0, "+Amount+","+vText
    +" \n");
    } else {
    f.write(vtDate+","+nRTTimeMin+","+getSymbol()+","+ Amount+",0,"+vText
    +" \n");
    }
    f.close();

    }
    Brad Matheny
    eSignal Solution Provider since 2000

    Comment


    • #3
      Hello Hiromichi,

      You should be able to create as many file objects as your machine can handle. Please post the code you're having trouble with.
      Jason K.
      Project Manager
      eSignal - an Interactive Data company

      EFS KnowledgeBase
      JavaScript for EFS Video Series
      EFS Beginner Tutorial Series
      EFS Glossary
      Custom EFS Development Policy

      New User Orientation

      Comment


      • #4
        Doji3333 and JasonK,
        Thank you for your replies, the following is my code and the section in question is marked.
        I am begining to think that maybe I should load all the symbols' data first before accesing them if that's possible.
        Hiromichi





        // genCSV

        var done

        function preMain(){
        done = false
        debugClear()
        }

        function main (){
        if (! done && isLastBarOnChart()) {
        done =true

        f = new File ( "testinputstatus.txt" ) // contains acces index into testinput.txt file
        f.open("rt");
        index = f.readln()
        f.close()
        if (index >= 0) {
        f = new File ( "testinput.txt" ) // contains symbols
        f.open("rt");
        symblYahoo = new Array ()
        symbl = new Array ()
        i = 0
        while (! f.eof()) {
        line = f.readln()
        if ( line != null ) {
        symblYahoo[i] = line
        ss = line.split(".")
        line = ss[0]
        ss = line.split("-")
        symbl[i] = ss.join("/")
        ++ i
        }
        }
        noSym = i
        f.close()

        // section in question **********************

        for (i=0;i<7 && 7*index+i<noSym;++i){
        f = new File ( symblYahoo[7*index+i] + ".csv" )
        debugPrintln ( "Processing " + symblYahoo[7*index+i] )
        f.open("wt");
        f.writeln("Date,Close")
        for (barIndex=0;barIndex>=getOldestBarIndex(symbl[7*index+i]);--barIndex){
        f.writeln(getMonth(barIndex,symbl[7*index+i])+"/"+
        getDay(barIndex,symbl[7*index+i])+"/"+
        getYear(barIndex,symbl[7*index+i])+","+
        close(barIndex,symbl[7*index+i]))
        }
        f.close()
        }

        // section in question (end) *********************

        f = new File ( "testinputstatus.txt" )
        f.open("wt");
        if (7*index+i==noSym) {
        f.writeln(-1)
        debugPrintln ( "Done with all symbols.")
        } else {
        ++index
        f.writeln(index)
        debugPrintln ( "Generated 7 files, rerun this script to continue.")
        }
        f.close()
        } else {
        debugPrintln ( "All files have already been generated.")
        }
        }
        }
        Last edited by hiromichi; 09-17-2007, 10:07 AM.

        Comment


        • #5
          I really don't know what you're trying to accomplish here.. But let's go over some of this code...


          for (i=0;i<7 && 7*index+i<noSym;++i){
          // I don't believe this supports an "&&" function - this could obviously be your your problem.

          f = new File ( symblYahoo[7*index+i] + ".csv" )
          // why are you multiplying the array pointer value??

          debugPrintln ( "Processing " + symblYahoo[7*index+i] )
          f.open("wt");
          f.writeln("Date,Close")
          //--------------------------------------------------------------------
          for (barIndex=0;barIndex>=getOldestBarIndex(symbl[7*index+i]);--barIndex){
          // You should check the value of getOldestBarIndex(??) for errors before you try to create a FOR LOOP out of it.


          // You might consider building a string value of all of this, then trying to write it to a file.
          f.writeln(getMonth(barIndex,symbl[7*index+i])+"/"+
          getDay(barIndex,symbl[7*index+i])+"/"+
          getYear(barIndex,symbl[7*index+i])+","+
          close(barIndex,symbl[7*index+i]))
          }
          f.close()
          }
          Brad Matheny
          eSignal Solution Provider since 2000

          Comment


          • #6
            Doji3333,
            Thank you for your inputs,
            What I am trying to do is to create .csv file of end of day prices of a number of securities which should be a lot easier than trying to export data from advanced chart. (I was trying to automate the process.)
            I believe "and" operator "&&" is supported by EFS.
            The reason for multiplying the index by 7 is the fact that I am processing 7 symbols at a time (EFS limit) and each time the index gets updated 7 symbols have been processed.
            Hiromichi
            Last edited by hiromichi; 09-17-2007, 06:39 PM.

            Comment


            • #7
              Hello Hiromichi,

              EFS has a 7 symbol limit to prevent this type of routine. EFS is not a tool to be used for mass exporting of data or for creating scanners.

              If you need to access and/or store local data for a larger set of symbols for a personal application you may want to consider using our Desktop API.
              Jason K.
              Project Manager
              eSignal - an Interactive Data company

              EFS KnowledgeBase
              JavaScript for EFS Video Series
              EFS Beginner Tutorial Series
              EFS Glossary
              Custom EFS Development Policy

              New User Orientation

              Comment

              Working...
              X