Announcement

Collapse
No announcement yet.

TickExtremes.efs

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

  • TickExtremes.efs

    File Name: TickExtremes.efs

    Description:
    Non-price study of $TICK draws HLC information and colors the bar red as the $TICK High or Low exceeds the upper or lower extreme parameters.

    Formula Parameters:
    nTickHigh: Default is 1000
    nTickLow: Default is –1000
    nNumBars: Default is 150

    Notes:
    The formula uses drawLineRelative() to create the bars and is set to only draw 150 bars of historical data. The larger the number of bars drawn with this function the slower the chart responds when scrolling back to view the history. The number can be increased as necessary through the “Edit Studies” option but try not to use too large a number for performance reasons.

    Download File:
    TickExtremes.efs




    EFS Code:
    PHP Code:
    /*********************************
    Provided By : eSignal. (c) Copyright 2003
    *********************************/

    function preMain() {
        
    setStudyTitle(" Tick Extremes ");
        
    setCursorLabelName("TICK  H"0);
        
    setCursorLabelName("TICK  L"1);
        
    setCursorLabelName("TICK  C"2);
        
    setPlotType(PLOTTYPE_DOT0);
        
    setPlotType(PLOTTYPE_DOT1);
        
    setPlotType(PLOTTYPE_FLATLINES2);
        
    setDefaultBarThickness(10);
        
    setDefaultBarThickness(11);
        
    setDefaultBarThickness(12);
        
    setDefaultBarFgColor(Color.blue0);
        
    setDefaultBarFgColor(Color.blue1);
        
    setDefaultBarFgColor(Color.black2);  
        
    setStudyMax(1500);
        
    setStudyMin(-1500);
    }

    var 
    vColor Color.blue;
    var 
    vLoaded false;
    var 
    barH null;
    var 
    barL null;
    var 
    vNum 150;
    var 
    BarCntr 0;

    function 
    main(nTickHighnTickLownNumOfBars) {   
        if (
    nTickHigh == nullnTickHigh 1000;
        if (
    nTickLow == nullnTickLow = -1000;
        if (
    vLoaded == false) {
            if (
    nNumOfBars != nullvNum Math.abs(Math.round(nNumOfBars));
            
    addBand(nTickHighPS_SOLID1Color.yellow"top");
            
    addBand(0PS_SOLID1Color.grey"zero");
            
    addBand(nTickLowPS_SOLID1Color.yellow"bottom");
            
    vLoaded true;
        }
        
        var 
    close(01"$tick")*1;
        if (
    == null) return;

        if (
    getBarState() == BARSTATE_NEWBAR) {
            if (
    BarCntr vNum) {
                
    BarCntr += 1;
            } else {
                
    BarCntr 0;
            }
            
    vColor Color.blue;
            
    barH c;
            
    barL c;
        }
        
        var 
    high(01"$tick")*1;
        if (
    == null) return;
        var 
    low(01"$tick")*1;
        if (
    == null) return;
        
        
    barH Math.max(barHhc);
        
    barL Math.min(barLlc);
        
        if (
    barH nTickHigh) {
            
    vColor Color.red;
        }
        if (
    barL nTickLow) {
            
    vColor Color.red;
        }

        
    setBarFgColor(vColor0);
        
    setBarFgColor(vColor1);
        
        
    drawLineRelative(0barL0barHPS_SOLID3vColor"bar" BarCntr);
        
        return new Array(
    barHbarLc);

    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
Working...
X