Announcement

Collapse
No announcement yet.

Export csv or txt OCHL data

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

  • Export csv or txt OCHL data

    Could anybody show me how to develop EFS to export OCHL E-Mini future's data automatically every day, I need 5min, daily, day session only and 24 hrs data,also plus S&P 500 Cash index daily bars. Any form of text format data would do

    Thanks in advance

  • #2
    Try using the TOOLS -> DATA EXPORT feature before you try developing an efs to accomplish this.
    Brad Matheny
    eSignal Solution Provider since 2000

    Comment


    • #3
      Thank you doji3333 for the reply, I did try Tool/data export....., it take too much time doing it every day, just wondering if it's possible to automate it using EFS. I am a programmer. All I need is that anybody could be so kind to provide me a little sample showing me how to read external symbols and write that to a text file, so I don't have to read a lot of EFS document.

      Thanks again

      Comment


      • #4
        ive been working on an efs to save OHLC to a text file, its not done yet, and its written for FOREX (specifically JPY pairs..) its not done yet.. but this is what i have

        PS: this is where it saves on my computer, the directory should be similar for you too "C:\Program Files (x86)\eSignal\FormulaOutput"

        PHP Code:
        var Finished false;

        function 
        preMain() {
            
        setPriceStudy(true);
            
        setColorPriceBars(false);
            
        setStudyTitle("Write to Text");
            
        setCursorLabelName("Write to Text",0)
            
        setPlotType(PLOTTYPE_FLATLINES0)
            
        setDefaultBarThickness(50);
            
        setDefaultBarFgColor(Color.RGB(0,0,255), 0);
        }

        function 
        main() {

        var 
        Delta 10000
        if (String(getSymbol()).replace("JPY","!") == String(getSymbol())) Delta 10000
        if (String(getSymbol()).replace("JPY","!") != String(getSymbol())) Delta 100

        if(getMonth() <10) var Temp1 String("0" getMonth())
        if(
        getDay() <10) var Temp2 String("0" getDay())
        if(
        getHour() <10) var Temp3 String("0" getHour())
        if(
        getMinute() <10) var Temp4 String("0" getMinute())

        if(
        getMonth() >=10) var Temp1 getMonth()
        if(
        getDay() >=10) var Temp2 getDay()
        if(
        getHour() >=10) var Temp3 getHour()
        if(
        getMinute() >=10) var Temp4 getMinute()

        var 
        Temp5 String(parseInt(open()*Delta)/Delta)
        var 
        Temp6 String(parseInt(high()*Delta)/Delta)
        var 
        Temp7 String(parseInt(low()*Delta)/Delta)
        var 
        Temp8 String(parseInt(close()*Delta)/Delta)

        if(
        Temp5.length == 6)  Temp5 +=  ""
        else if(Temp5.length == 5)  Temp5 +=  "0"
        else if(Temp5.length == 3)  Temp5 +=  ".00"

        if(Temp6.length == 6Temp6 +=  ""
        else if(Temp6.length == 5Temp6 +=  "0"
        else if(Temp6.length == 3Temp6 +=  ".00"

        if(Temp7.length == 6Temp7 +=  ""
        else if(Temp7.length == 5Temp7 +=  "0"
        else if(Temp7.length == 3Temp7 +=  ".00"

        if(Temp8.length == 6Temp8 += ""
        else if(Temp8.length == 5)  Temp8 +=  "0"
        else if(Temp8.length == 3)  Temp8 +=  ".00"

        if (Finished != true){
            var 
        txt = new File(getSymbol() + ".txt");
            
        txt.open"at" );
            
        txt.writeln(getSymbol() + "|" Temp1 "/" Temp2 "/" getYear() + "|" Temp3 ":" Temp4 "|O""=" Temp5 "|H""=" Temp6 "|L""=" Temp7 "|C""=" Temp8);
            
        txt.close()
        }
            
        if (
        getBarState() == BARSTATE_ALLBARS && getCurrentBarIndex() == -1Finished true

            
        return "Finished!"
        }

        function 
        Left(strn){
            if (
        <= 0)
                return 
        "";
            else if (
        String(str).length)
                return 
        str;
            else
                return 
        String(str).substring(0,n);
        }

        function 
        Right(strn){
            if (
        <= 0)
               return 
        "";
            else if (
        String(str).length)
               return 
        str;
            else {
               var 
        iLen String(str).length;
               return 
        String(str).substring(iLeniLen n);
            }

        Last edited by kalzenith; 09-21-2009, 09:32 AM.

        Comment

        Working...
        X