Announcement

Collapse
No announcement yet.

2013 Mar: Camarilla Points, by Slawomir Bobrowski

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

  • 2013 Mar: Camarilla Points, by Slawomir Bobrowski

    File Name: CamarillaPoints.efs

    Description:
    Camarilla Points, by Slawomir Bobrowski

    Formula Parameters:

    CamarillaPoints.efs
    Resistance level Color purple
    Support Level Color magenta
    Buy Signal Color green
    Sell Signal Color red
    Time Frame Period 15

    Notes:
    The related article is copyrighted material. If you are not a subscriber
    of Stocks & Commodities, please visit www.traders.com.

    Download File:
    CamarillaPoints.efs

    CamarillaPoints.efs


    EFS Code:
    PHP Code:
    /*********************************
    Provided By:  
    eSignal (Copyright c eSignal), a division of Interactive Data 
    Corporation. 2012. All rights reserved. This sample eSignal 
    Formula Script (EFS) is for educational purposes only and may be 
    modified and saved under a new file name.  eSignal is not responsible
    for the functionality once modified.  eSignal reserves the right 
    to modify and overwrite this EFS file with each new release.

    Description:     
        Camarilla Points, by Slawomir Bobrowski

    Version:            1.00  01/10/2013

    Formula Parameters:                         Default:
    Resistance level Color                      purple
    Support Level Color                         magenta
    Buy Signal Color                            green
    Sell Signal Color                           red
    Time Frame Period                           15

    Notes:
    The related article is copyrighted material. If you are not a subscriber
    of Stocks & Commodities, please visit www.traders.com.

    **********************************/

    var fpArray = new Array();

    function 
    preMain()
    {   
        
    setPriceStudy(true);
        
    setStudyTitle("Camarilla Points");    
        
        
    setCursorLabelName("R5",0);    
        
    setPlotType(PLOTTYPE_FLATLINES,0);
        
    setCursorLabelName("R4",1);    
        
    setPlotType(PLOTTYPE_FLATLINES,1);
        
    setCursorLabelName("R3",2);    
        
    setPlotType(PLOTTYPE_FLATLINES,2);
        
    setCursorLabelName("R2",3);
        
    setPlotType(PLOTTYPE_FLATLINES,3);
        
    setCursorLabelName("R1",4);
        
    setPlotType(PLOTTYPE_FLATLINES,4);
        
        
    setCursorLabelName("S1",5);
        
    setPlotType(PLOTTYPE_FLATLINES,5);
        
    setCursorLabelName("S2",6);
        
    setPlotType(PLOTTYPE_FLATLINES,6);
        
    setCursorLabelName("S3",7);    
        
    setPlotType(PLOTTYPE_FLATLINES,7);
        
    setCursorLabelName("S4",8);     
        
    setPlotType(PLOTTYPE_FLATLINES,8);   
        
    setCursorLabelName("S5",9);   
        
    setPlotType(PLOTTYPE_FLATLINES,9); 
        
        var 
    0;
        
        
    fpArray[x] = new FunctionParameter("gRColor"FunctionParameter.COLOR);
        
    with(fpArray[x++])
        {
            
    setName("Resistance level Color");        
            
    setDefault(Color.purple);
        }  

        
    fpArray[x] = new FunctionParameter("gSColor"FunctionParameter.COLOR);
        
    with(fpArray[x++])
        {
            
    setName("Support Level Color");        
            
    setDefault(Color.magenta);
        }  

        
    fpArray[x] = new FunctionParameter("gBuyColor"FunctionParameter.COLOR);
        
    with(fpArray[x++])
        {
            
    setName("Buy Signal Color");        
            
    setDefault(Color.green);
        }  

        
    fpArray[x] = new FunctionParameter("gSellColor"FunctionParameter.COLOR);
        
    with(fpArray[x++])
        {
            
    setName("Sell Signal Color");        
            
    setDefault(Color.red);
        }  

        
    fpArray[x] = new FunctionParameter("gDays"FunctionParameter.NUMBER);
        
    with(fpArray[x++])
        {
            
    setName("Time Frame Period");        
            
    setDefault(15);
        } 
    }

    var 
    bInit false;
    var 
    bVersion null;

    var 
    xHHigh  null;
    var 
    xLLow   null;
    var 
    xClose null

    var 
    xHigh  null;
    var 
    xLow   null;

    var 
    nR1 null;
    var 
    nS1 null;
    var 
    nR2 null;
    var 
    nS2 null;  
    var 
    nR3 null;
    var 
    nS3 null;
    var 
    nR4 null;
    var 
    nS4 null;
    var 
    nR5 null;
    var 
    nS5 null;

    function 
    main(gRColor,gSColor,gBuyColor,gSellColor,gDays)
    {
        if (
    bVersion == nullbVersion verify();
        if (
    bVersion == false) return;   
        
        
    setDefaultBarFgColor(gRColor0);      
        
    setBarStyle(PS_DASH,0);
        
    setDefaultBarFgColor(gRColor1);  
        
    setBarStyle(PS_DASH,1);
        
    setDefaultBarFgColor(gRColor2);  
        
    setDefaultBarThickness(2,2);
        
    setDefaultBarFgColor(gRColor3);  
        
    setBarStyle(PS_DASH,3);
        
    setDefaultBarFgColor(gRColor4);  
        
    setBarStyle(PS_DASH,4);
       
        
    setDefaultBarFgColor(gSColor5);  
        
    setBarStyle(PS_DASH,5);
        
    setDefaultBarFgColor(gSColor6);  
        
    setBarStyle(PS_DASH,6);
        
    setDefaultBarFgColor(gSColor7);      
        
    setDefaultBarThickness(2,7);
        
    setDefaultBarFgColor(gSColor8);  
        
    setBarStyle(PS_DASH,8);    
        
    setDefaultBarFgColor(gSColor9);  
        
    setBarStyle(PS_DASH,9);
        
        if(!
    bInit)
        {
            
    xHHigh  highest(gDays,high()); 
            
    xLLow   lowest(gDays,low());
            
    xClose close();
            
            
    xHigh high();
            
    xLow low();
            
            
    bInit true;
        }

        if (
    getBarState()==BARSTATE_ALLBARS)
        {        
            
    nR5 nR4 nR3 nR2 nR1 null;
            
    nS1 nS2 nS3 nS4 nS5 null;
        }
            
        if ((
    getCurrentBarIndex()-1) % (gDays) == 0)
        {  
            var 
    nHHigh  xHHigh.getValue(-1);
            var 
    nLLow   xLLow.getValue(-1);
            var 
    nClose xClose.getValue(-1); 
            
            if(
    nHHigh == null || nLLow == null || nClose == null || nLLow == 0)
            return;          
                    
            var 
    nRange nHHigh-nLLow;
            
            
    nR5 = (nHHigh/nLLow)*nClose;
            
    nR4 nClose+nRange*1.1/2;
            
    nR3 nClose+nRange*1.1/4;    
            
    nR2 nClose+nRange*1.1/6;
            
    nR1 nClose+nRange*1.1/12;

            
    nS1 nClose-nRange*1.1/12;
            
    nS2 nClose-nRange*1.1/6;  
            
    nS3 nClose-nRange*1.1/4;
            
    nS4 nClose-nRange*1.1/2;
            
    nS5 nClose-(nR5-nClose);
            
            
            
    drawTextAbsolute(getCurrentBarIndex()+gDays-1nR1" R1 "gRColornullText.LEFT Text.BOLD Text.ONTOPnullnull,getCurrentBarIndex());               
            
    drawTextAbsolute(getCurrentBarIndex()+gDays-1nR2" R2 "gRColornullText.LEFT Text.BOLD Text.ONTOPnullnull,getCurrentBarIndex()+1);               
            
    drawTextAbsolute(getCurrentBarIndex()+gDays-1nR3" R3 "gRColornullText.LEFT Text.BOLD Text.ONTOPnullnull,getCurrentBarIndex()+2);               
            
    drawTextAbsolute(getCurrentBarIndex()+gDays-1nR4" R4 "gRColornullText.LEFT Text.BOLD Text.ONTOPnullnull,getCurrentBarIndex()+3);               
            
    drawTextAbsolute(getCurrentBarIndex()+gDays-1nR5" R5 "gRColornullText.LEFT Text.BOLD Text.ONTOPnullnull,getCurrentBarIndex()+4);               
            
            
    drawTextAbsolute(getCurrentBarIndex()+gDays-1nS1" S1 "gSColornullText.LEFT Text.BOLD Text.ONTOPnullnull,getCurrentBarIndex()+5);               
            
    drawTextAbsolute(getCurrentBarIndex()+gDays-1nS2" S2 "gSColornullText.LEFT Text.BOLD Text.ONTOPnullnull,getCurrentBarIndex()+6);
            
    drawTextAbsolute(getCurrentBarIndex()+gDays-1nS3" S3 "gSColornullText.LEFT Text.BOLD Text.ONTOPnullnull,getCurrentBarIndex()+7);
            
    drawTextAbsolute(getCurrentBarIndex()+gDays-1nS4" S4 "gSColornullText.LEFT Text.BOLD Text.ONTOPnullnull,getCurrentBarIndex()+8);
            
    drawTextAbsolute(getCurrentBarIndex()+gDays-1nS5" S5 "gSColornullText.LEFT Text.BOLD Text.ONTOPnullnull,getCurrentBarIndex()+9);        
            
        }       
        
        var 
    nHigh xHigh.getValue(0);
        var 
    nLow xLow.getValue(0);
       
        if(
    nHigh == null || nLow == null)
        return;  

        if ((
    nR3<nHigh) && (nR3>nLow)) drawShapeRelative(0TopRow3 Shape.DIAMONDnullgSellColorShape.PRESET);
        if ((
    nS3<nHigh) && (nS3>nLow)) drawShapeRelative(0BottomRow3 Shape.DIAMONDnullgBuyColorShape.PRESET);
        
        return new Array(
    nR5,nR4,nR3,nR2,nR1,nS1nS2nS3,nS4,nS5);        
    }

    function 
    verify() {
        var 
    false;
        if (
    getBuildNumber() < 779) {
            
    drawTextAbsolute(535"This study requires version 8.0 or later."
                
    Color.whiteColor.blueText.RELATIVETOBOTTOM|Text.RELATIVETOLEFT|Text.BOLD|Text.LEFT,
                
    null13"error");
            
    drawTextAbsolute(520"Click HERE to upgrade.@URL=http://www.esignal.com/download/default.asp"
                
    Color.whiteColor.blueText.RELATIVETOBOTTOM|Text.RELATIVETOLEFT|Text.BOLD|Text.LEFT,
                
    null13"upgrade");
            return 
    b;
        } else {
            
    true;
        }
        return 
    b;

    Last edited by eSignal; 02-14-2013, 10:20 PM.
Working...
X