Announcement

Collapse
No announcement yet.

Using EFS to denote a new day

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Using EFS to denote a new day

    Some people in the SiliconInvestor forums were wanting more grid lines on their chart - specifically for 60, 120 minute charts.

    It occurred to me that there is a way to solve this problem using EFS. With EFS, a new day can be detected and when that happens, EFS can draw a shape at the bottom of the chart to denote a new day.

    Code:
    function preMain() {
    	setPriceStudy(true);
    	setStudyTitle("");
    	setShowCursorLabel(false);
    }
    
    var vLastTime = null;
    function main() {
    	var vRawTime = getValue("rawtime");
                    if(vRawTime == null) {
    		return;
                    }
    	
    	vRawTime = Math.floor(vRawTime / RawTime.DAY);
    	if(vLastTime != null  && vRawTime != vLastTime) {
    		// Other shapes
    		// Shape.CIRCLE
    		// Shape.SQUARE		
    		// Shape.TRIANGLE	
    		// Shape.DIAMOND		
    		// Shape.LEFTARROW	
    		// Shape.RIGHTARROW	
    		// Shape.UPARROW		
    		// Shape.DOWNARROW	
    		// x, y, shape, url, color, flags, tag name
    		drawShapeRelative(0, 0, Shape.DIAMOND, "", Color.blue, Shape.RELATIVETOBOTTOM, "NewDay" + vRawTime);
    	}
    	
    	vLastTime = vRawTime;
    		
    }


    - Matt Gundersen
    Last edited by magic; 10-31-2002, 08:56 PM.

  • #2
    Hi Magic,

    Thanks a lot for the "new day marker".

    I'm a new Esignal user, and was missing the lines that separate the days on 60 minute charts badly. Thanks for the quick solution !

    Fibonacci

    Comment


    • #3
      Problem with program

      Hi Magic & Fib3003.
      This is exactly what I was after! I've migrated from AIQ to esignal recently and had been missing the inter-day marker on intraday.
      Magic, I typed in your program word for word (please see my attached file) but I am missing something as it gives me a syntax error (i'm missing a bracket on line 15). Ive tried all sorts but it won't disappear- your help would be appreciated. Ive missed something obvious but I cant see the wood for the trees I think!!
      Thanks in advance
      John
      Attached Files

      Comment


      • #4
        click on the link below, save it to the formulas directory and reload it from there.
        Attached Files

        Comment


        • #5
          Interday marker

          Hi David, thanks very much David for doing that. I've compared yours with mine and I can see where I went wrong. Some syntax with the light blue vertical dotted line on the "if" statements.
          Anyway, thanks again
          John

          Comment

          Working...
          X