Announcement

Collapse
No announcement yet.

TickiExtremes.efs

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

  • TickiExtremes.efs

    File Name: TickiExtremes.efs

    Main Category: Spreads / Overlays

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

    Formula Parameters:
    nTickiHigh: Default is 24
    nTickiLow: Default is -24
    nNumBars: Default is 150

    Notes:


    Download File:
    TickiExtremes.efs




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

    /***  Updated:  5/30/03

    *Changed logic for creating HL bars from histograms to drawLineRelative()
        lines similar to TickExtremes.efs.

    ***/

    /***  Updated:  4/30/03

    *Changed color scheme to red(extreme breach)/blue(no breach).
    *Logic for High/Low of bar improved.
    *Fixed bug for Edit Studies change of nTickiHigh/nTickiLow.

    ***/

    function preMain() {
        
    setStudyTitle(" Ticki Extremes ");
        
    setCursorLabelName("TICKI  H"0);
        
    setCursorLabelName("TICKI  L"1);
        
    setCursorLabelName("TICKI  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);    
    }

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

    function 
    main(nTickiHighnTickiLow,  nNumOfBars) {
        if (
    nTickiHigh == nullnTickiHigh 24;
        if (
    nTickiLow == nullnTickiLow = -24;
        if (
    vLoaded == false) {
            if (
    nNumOfBars != nullvNum Math.abs(Math.round(nNumOfBars));
            
    addBand(nTickiHighPS_SOLID1Color.yellow"top");
            
    addBand(0PS_SOLID1Color.grey"zero");
            
    addBand(nTickiLowPS_SOLID1Color.yellow"bottom");
            
    vLoaded true;
        }
        
        var 
    close(01"$ticki")*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"$ticki")*1;
        if (
    == null) return;
        var 
    low(01"$ticki")*1;
        if (
    == null) return;
        
        
    barH Math.max(barHhc);
        
    barL Math.min(barLlc);
        
        if (
    barH nTickiHigh) {
            
    vColor Color.red;
        }
        if (
    barL nTickiLow) {
            
    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