Announcement

Collapse
No announcement yet.

View historical values.

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

  • View historical values.

    Hi Guys,

    First post here so apologies for being new. I did try the search button before posting here so if my question is repeated apologies.

    I have the ACD indicator(See Attached).

    Is it possible in Esignal so that I can see historical values of this indicator on the chart?

    It only displays current values but no historical and so is little use in this current state.

    Any Help would be much appreciated.

    Thanks.

    RB.
    Attached Files

  • #2
    Hi RB,

    Any Help would be much appreciated.

    Thanks.

    RB.
    I think this does what you asked for.

    xMin Range_ACD LInes All.efs

    PHP Code:
    //http://forum.esignal.com/showthread.php?40096-View-historical-values
    /***
    This formula will display the high/low lines of the opening range and
    the A & C lines for the day based on the book "The Logical Trader".
    ***/
    /***
    10/7/2015 waynecd added multiple day plotting capability
    NOTES:
        This script is intended for intraday intervals only.
    **/
        
    function preMain() {
        
    setPriceStudy(true);
        
    //setStudyTitle("ACD System");
        
    setCursorLabelName("30m H"0);
        
    setCursorLabelName("30m L"1);
        
    setCursorLabelName("C Up "2);
        
    setCursorLabelName("A Up "3);
        
    setCursorLabelName("A Down"4);
        
    setCursorLabelName("C Down"5);
        
    setDefaultBarFgColor(Color.blue0);
        
    setDefaultBarFgColor(Color.blue1);
        
    setDefaultBarFgColor(Color.green2);
        
    setDefaultBarFgColor(Color.green3);
        
    setDefaultBarFgColor(Color.red4);
        
    setDefaultBarFgColor(Color.red5);
        
    setDefaultBarThickness(10);
        
    setDefaultBarThickness(11);
        
    setDefaultBarThickness(12);
        
    setDefaultBarThickness(13);
        
    setDefaultBarThickness(14);
        
    setDefaultBarThickness(15);
        
    setPlotType(PLOTTYPE_FLATLINES0);
        
    setPlotType(PLOTTYPE_FLATLINES1);
        
    setPlotType(PLOTTYPE_FLATLINES2);
        
    setPlotType(PLOTTYPE_FLATLINES3);
        
    setPlotType(PLOTTYPE_FLATLINES4);
        
    setPlotType(PLOTTYPE_FLATLINES5);

        var 
    fp1 = new FunctionParameter("nMin"FunctionParameter.NUMBER);
        
    fp1.setName("Number of Minutes");
        
    fp1.setLowerLimit(1);
        
    fp1.setDefault(60);

        var 
    fp2 = new FunctionParameter("nThickness"FunctionParameter.NUMBER);
        
    fp2.setName("Line Thickness");
        
    fp2.setLowerLimit(1);
        
    fp2.setDefault(2);

        var 
    fp3 = new FunctionParameter("cColorH"FunctionParameter.COLOR);
        
    fp3.setName("High Color");
        
    fp3.setDefault(Color.RGB(0,0,192));

        var 
    fp4 = new FunctionParameter("cColorL"FunctionParameter.COLOR);
        
    fp4.setName("Low Color");
        
    fp4.setDefault(Color.RGB(0,0,192));

        var 
    fp5 = new FunctionParameter("nTicksA"FunctionParameter.NUMBER);
        
    fp5.setName("Ticks for A");
        
    fp5.setLowerLimit(.01);
        
    fp5.setDefault(1)

        var 
    fp6 = new FunctionParameter("nTicksC"FunctionParameter.NUMBER);
        
    fp6.setName("Ticks for C");
        
    fp6.setLowerLimit(.01);
        
    fp6.setDefault(1)

        var 
    fp7 = new FunctionParameter("cColorCUp"FunctionParameter.COLOR);
        
    fp7.setName("C Up Color");
        
    fp7.setDefault(Color.RGB(0,133,0));

        var 
    fp8 = new FunctionParameter("cColorAUp"FunctionParameter.COLOR);
        
    fp8.setName("A Up Color");
        
    fp8.setDefault(Color.RGB(0,133,0));

        var 
    fp9 = new FunctionParameter("cColorADown"FunctionParameter.COLOR);
        
    fp9.setName("A Down Color");
        
    fp9.setDefault(Color.RGB(192,0,0));

        var 
    fp10 = new FunctionParameter("cColorCDown"FunctionParameter.COLOR);
        
    fp10.setName("C Down Color");
        
    fp10.setDefault(Color.RGB(192,0,0));

        var 
    fp11 = new FunctionParameter("DisplayNo"FunctionParameter.NUMBER);
        
    fp11.setName("# Of Days To Display");
        
    fp11.setLowerLimit(1);
        
    fp11.addOption(1);
        
    fp11.addOption(2);
        
    fp11.addOption(20);
        
    fp11.setDefault(1);

        var 
    fp12 = new FunctionParameter("DisplayPastPrices"FunctionParameter.BOOLEAN);
        
    fp12.setName("Display Past Price Labels");
        
    fp12.setDefault(true);

        var 
    fp13 = new FunctionParameter("FontSize"FunctionParameter.NUMBER);
        
    fp13.setName("Price Label Font Size");
        
    fp13.setLowerLimit(1);
        
    fp13.addOption(6);
        
    fp13.addOption(7);
        
    fp13.addOption(8);
        
    fp13.addOption(9);
        
    fp13.addOption(10);
        
    fp13.addOption(11);
        
    fp13.setDefault(6);
        
        var 
    fp14 = new FunctionParameter("LineLength"FunctionParameter.NUMBER);
        
    fp14.setName("Past Price Line Length");
        
    fp14.setLowerLimit(1);
        
    fp14.addOption(6);
        
    fp14.addOption(7);
        
    fp14.addOption(8);
        
    fp14.addOption(9);
        
    fp14.addOption(10);
        
    fp14.addOption(11);
        
    fp14.setDefault(6);
        
        var 
    fp15 = new FunctionParameter("TodayLineEnd"FunctionParameter.NUMBER);
        
    fp15.setName("Bar Index To End Todays Line");
        
    fp15.setLowerLimit(1);
        
    fp15.setDefault(1);
    }

    var 
    bEdit true;
    var 
    bActive true;
    var 
    nDayCntr 0;

    var 
    vStartTime null;
    var 
    vHigh null;
    var 
    vLow null;
    var 
    FirstBar = [];//null;
    var drawCtr=0;

    function 
    main(nMinnThicknesscColorHcColorLcColorCUpcColorAUpcColorADowncColorCDownnTicksAnTicksC,DisplayNo,DisplayPastPrices,FontSize,LineLength,TodayLineEnd) {
        if(
    isDWM()) return
        var 
    startTxt=0;
        var 
    startBar=0;
        var 
    endBar=0;
        var 
    is_It_Today=is_Today();
        if(
    isLastBarOnChart()) is_It_Today=true;
        if (
    nMin == nullnMin 60;
        if (
    bEdit == true) {
            
    nMin Math.round(nMin);
            
    setCursorLabelName(nMin "min H"0);
            
    setCursorLabelName(nMin "min L"1);
            
    setDefaultBarThickness(nThickness0);
            
    setDefaultBarThickness(nThickness0);
            
    setDefaultBarFgColor(cColorH0);
            
    setDefaultBarFgColor(cColorL1);
            
    setDefaultBarFgColor(cColorCUp2);
            
    setDefaultBarFgColor(cColorAUp3);
            
    setDefaultBarFgColor(cColorADown4);
            
    setDefaultBarFgColor(cColorCDown5);
            
    bEdit false;
        }
        if (
    getDay(0) != getDay(-1) || vHigh == null || vLow == null) {
            
    bActive true;
            
    nDayCntr += 1;
            
    vStartTime getValue("Time");
            
    vHigh high();
            
    vLow low();
        }

        
    FirstBar[FirstBar.length] = getFirstBarIndexOfDay(vStartTime);
        var 
    vTime getValue("Time");

        
    // 3,600,000 milliseconds = 1 hour
        // 60,000 milliseconds = 1 minute
        
    if ((vTime vStartTime)/60000 nMin) {
            
    vHigh Math.max(high(), vHigh);
            
    vLow Math.min(low(), vLow);
        } else {
            
    bActive false;
        }

        if (
    FirstBar != null){
            if(
    getDay(0) != getDay(-1)) {
                
    fDrawStuff(DisplayNo+1,vHigh,nThickness,cColorH,nTicksC,cColorCUp,nTicksA,cColorAUp,vLow,cColorL,cColorADown,cColorCDown,2,LineLength,LineLength+2,false,DisplayPastPrices,FontSize);
            }
            if(
    is_It_Today){
                if(
    getBarState()==BARSTATE_NEWBAR){
                    
    fDrawStuff(DisplayNo+1,vHigh,nThickness,cColorH,nTicksC,cColorCUp,nTicksA,cColorAUp,vLow,cColorL,cColorADown,cColorCDown,FirstBar[FirstBar.length-1],TodayLineEnd,TodayLineEnd+1,true,DisplayPastPrices,FontSize);
                }
            }
        }

        if (
    bActive == false) {
            return new Array(
    vHigh.toFixed(2), vLow.toFixed(2),(vHigh+nTicksC).toFixed(2),(vHigh+nTicksA).toFixed(2),(vLow-nTicksA).toFixed(2),(vLow-nTicksC).toFixed(2));
        }
        return 
    null;
    }
    var 
    flag=true;
    function 
    fDrawStuff(DisplayNo,vHigh,nThickness,cColorH,nTicksC,cColorCUp,nTicksA,cColorAUp,vLow,cColorL,cColorADown,cColorCDown,startBar,endBar,startTxt,isLastDay,DisplayPricesLabels,FontSize){
        if(
    isLastDay && flag){
            
    removeLine("Hline"+drawCtr);
            
    removeText"High"+drawCtr);
            
    removeLine"CUp"+drawCtr);
            
    removeText("CUp"+drawCtr);
            
    removeLine("AUp"+drawCtr);
            
    removeText("AUp"+drawCtr);
            
    removeLine("Lline"+drawCtr)
            
    removeText("Low"+drawCtr);
            
    removeLine("ADown"+drawCtr);
            
    removeText("ADown"+drawCtr);
            
    removeLine("CDown"+drawCtr);
            
    removeText("CDown"+drawCtr);
            
    DisplayPricesLabels=true;
            
    flag=false;
        }
        
    drawCtr++;
        if(
    drawCtr>=DisplayNodrawCtr=0;
        
    drawLineRelativestartBarvHighendBarvHighPS_DASHDOTnThickness,cColorH"Hline"+drawCtr);
        
    drawLineRelativestartBarvHigh+nTicksCendBar,vHigh+nTicksCPS_DOTnThicknesscColorCUp"CUp"+drawCtr);
        
    drawLineRelativestartBarvHigh+nTicksAendBar,vHigh+nTicksAPS_DASHnThicknesscColorAUp"AUp"+drawCtr);
        
    drawLineRelativestartBarvLowendBarvLowPS_DASHDOTnThicknesscColorL"Lline"+drawCtr)
        
    drawLineRelativestartBarvLow-nTicksAendBar,vLow-nTicksAPS_DASHnThicknesscColorADown"ADown"+drawCtr);
        
    drawLineRelativestartBarvLow-nTicksCendBar,vLow-nTicksCPS_DOTnThicknesscColorCDown"CDown"+drawCtr);
        if(
    DisplayPricesLabels){
            
    drawTextRelativestartTxtvHighvHigh.toFixed(2), cColorHnullText.VCENTER|Text.BOLDnullFontSize"High"+drawCtr);
            
    drawTextRelativestartTxtvHigh+nTicksC, (vHigh+nTicksC).toFixed(2), cColorCUpnullText.VCENTER|Text.BOLDnullFontSize"CUp"+drawCtr);
            
    drawTextRelativestartTxtvHigh+nTicksA, (vHigh+nTicksA).toFixed(2), cColorAUpnullText.VCENTER|Text.BOLDnullFontSize"AUp"+drawCtr);
            
    drawTextRelativestartTxtvLowvLow.toFixed(2), cColorLnullText.VCENTER|Text.BOLDnullFontSize"Low"+drawCtr);
            
    drawTextRelativestartTxtvLow-nTicksA, (vLow-nTicksA).toFixed(2), cColorADownnullText.VCENTER|Text.BOLDnullFontSize"ADown"+drawCtr);
            
    drawTextRelativestartTxtvLow-nTicksC, (vLow-nTicksC).toFixed(2), cColorCDownnullText.VCENTER|Text.BOLDnullFontSize"CDown"+drawCtr);
        }
    }
    function 
    is_Today(){//"bCurrentDay" only works while the chart receives ticks so it's always false when Mkt is closed
        
    var bCurrentDay false;
        var 
    xTime getValue("time"); 
        var 
    xDate = new Date();  
        var 
    sTime = (xTime.getMonth()+1+"/"+xTime.getDate()+"/"+xTime.getFullYear()); 
        var 
    sToday = (xDate.getMonth()+1+"/"+xDate.getDate()+"/"+xDate.getFullYear()); 
        if ( 
    sTime == sToday ) { 
            
    bCurrentDay true
        } 
        return 
    bCurrentDay;

    Wayne
    Last edited by waynecd; 10-17-2015, 05:05 PM.

    Comment


    • #3
      Hi Wayne,

      Thanks for trying to help out.

      I tried the code and it compiled fine however I still seem to have the original problem of seeing the levels from past days.

      Do you think its anything to do with my esignal configuration?

      All the best,

      James.

      Comment


      • #4
        Use this revised version. My original repeated the current days price.

        xMin Range_ACD LInes All.efs

        It only displays current values but no historical and so is little use in this current state.
        I expect menu settings are the issue:

        The first thing to note is that the efs does not draw on daily, weekly, or monthly intervals.

        Here is an explanation of what the added menu items do.

        Menu Item Titled:
        "# Of Days To Display": if set to 1 it will display one day so increase the # to have it draw more days
        "Display Past Price Labels": checked=the price will be displayed for days in the past, unchecked= they won't be drawn
        "Price Label Font Size": modifies the size of the displayed price font
        "Past Price Line Length": modifies the length of the drawn line for past days
        "Bar Index To End Todays Line": sets position of displayed price only for the current day

        Play with those settings on a 60 min chart that displays several days so you can easily see what they change on the chart.
        It will draw the same on other non daily/weekly/monthly intervals.

        Wayne
        Last edited by waynecd; 10-20-2015, 04:08 AM.

        Comment


        • #5
          Hi James,

          Just in case that what you are asking for is for the lines to extend to the right edge of the chart past the most current bar: It can easily be done but you will end up with a mess of lines indistinguishable as to origin date for dates not displayed on the chart.

          Hopefully that made sense.

          I corrected an error so it's best if test/use the following version:

          xMin Range_ACD LInes All.efs

          Wayne
          Last edited by waynecd; 10-20-2015, 01:17 PM.

          Comment


          • #6
            Originally posted by waynecd View Post
            Hi James,

            Just in case that what you are asking for is for the lines to extend to the right edge of the chart past the most current bar: It can easily be done but you will end up with a mess of lines indistinguishable as to origin date for dates not displayed on the chart.

            Hopefully that made sense.

            I corrected an error so it's best if test/use the following version:

            [ATTACH]16804[/ATTACH]

            Wayne
            Wayne,

            Thanks so much for helping me with this. It works perfect and just needed a few tweaks as you suggested.

            I have just migrated over from Tradestation and the Esignal is nothing like easy language like I am used to.

            In the future I will be looking at modifying this indicator so that the tick value is a percentage of TrueRange over 10 - 20 days so that it adapts for changes in volatility.

            I also intend on creating 3 more versions of this indicator one to display levels on a weekly basis using 1/2 trading day for the opening range. A monthly indicator using the first day of the month for the opening range and quarterly which will use the first week of the quarter for the opening range.

            Do you think that a noob would be capable of completing these projects? If not would you be interested in this work or can you recommend a programer for this? How much would you say that I would need to budget for these modifications?

            All the best,

            James.

            Comment


            • #7
              James,

              Your welcome.

              I am not a programmer. I like you, had an interest. I just jumped in and learned it. The programming you describe is not so complicated and something I believe you can do after overcoming the learning curve.
              Here are some resources:
              eSignal File Share (for sample and functional scripts)
              Forum searches yield answers to the majority of efs programming questions.
              as well as resources listed at http://www.esignal.com/community.aspx?tc=

              If you prefer a paid programmer here are eSignal web pages for that:

              Developing eSignal Formula Studies
              Formula Developers. Divergence Software, Inc. was used by an acquaintance who was pleased with their work and price. I haven't used them.

              Wayne
              Last edited by waynecd; 10-21-2015, 05:48 AM.

              Comment

              Working...
              X