Developing/EOD Camrilla

Hello,

I need help with the following things to set-up my system.

  1. I have scanner - that I use to see camarilla levels for my stocks- they use yesterday' OHLC to calculate the levels. However, at the end of the day, it still shows me today's levels - I need to be able to see tomorrow's levels & (run rules on it) . I need help in potting them on the chart for tomorrow as well

See my scanner code


_SECTION_BEGIN( "Camrilla Pivots-Master File Scanner" );
//Compiled by Abhishek

    _N( DropBox = ParamList( "Pivot TimeFrame", "inDaily|inWeekly|inMonthly" ) );
    tmfrm = VarGet( ParamList( "Pivot TimeFrame", "inDaily|inWeekly|inMonthly" ) );

if( Status( "action" ) == actionExplore )
{
    format    = 1.2;
    width     = 70;
    Colfont   = colorBrightGreen;
    Colfont2   = colorGold;
    Colfont4   = colorWhite;
    Colfont3   = colorGold;
    Colcell2   = colorDarkRed;
    Colcell  = colorDarkGrey;

//Camarilla pivots calculation-START


    DayH = TimeFrameGetPrice( "H", tmfrm, -1 );
    DayL = TimeFrameGetPrice( "L", tmfrm, -1 );
    DayC = TimeFrameGetPrice( "C", tmfrm, -1 );

    H5 = ( DayH / DayL ) * DayC;
    H4 = ( ( DayH - DayL ) * ( 1.1 / 2 ) ) + DayC;
    H3 = ( ( DayH - DayL ) * ( 1.1 / 4 ) ) + DayC;
    R2 = ( ( DayH - DayL ) * ( 1.1 / 6 ) ) + DayC;
    R1 = ( ( DayH - DayL ) * ( 1.1 / 12 ) ) + DayC;

    S1 = DayC - ( ( DayH - DayL ) * ( 1.1 / 12 ) );
    S2 = DayC - ( ( DayH - DayL ) * ( 1.1 / 6 ) ) ;
    L3 = DayC - ( ( DayH - DayL ) * ( 1.1 / 4 ) ) ;
    L4 = DayC - ( ( DayH - DayL ) * ( 1.1 / 2 ) ) ;
    L5 = DayC - ( H5 - DayC );

//Camarilla pivots calculation-END

//Open Interst and Price Rules

    Cng = ( ( Ref( C, 0 ) - Ref( C, -1 ) ) ) / Ref( C, -1 ) * 100;
    CngOI = ( ( Ref( OI, 0 ) - Ref( OI, -1 ) ) ) / Ref( OI, -1 ) * 100;
    SetOption( "NoDefaultColumns", True );
    SetSortColumns( 2 );


    AddTextColumn( Name(), "Ticker", 1.0, Colfont, Colcell, width );
    AddColumn( DateTime(), "Date/Time", formatDateTime, Colfont, Colcell, 120 );
    AddColumn( C, "Close", 1, Colfont, Colcell, width );
    //AddColumn(LastValue(H), "Tom H4", format, Colfont, Colcell, width );
    AddColumn( Cng, "Change%", 1.2, Colfont, Colcell, width );
    AddColumn( H4, "H4", format, Colfont, Colcell, width );
	AddColumn( H3, "H3", format, Colfont, Colcell, width );
    AddColumn( L3, "L3", format, Colfont, Colcell, width );
    AddColumn( L4, "L4", format, Colfont, Colcell, width );
    AddColumn( R2, "R2", format, Colfont, Colcell, width );
    AddColumn( R1, "R1", format, Colfont, Colcell, width );
    AddColumn( S1, "S1", format, Colfont, Colcell, width );
    AddColumn( S2, "S2", format, Colfont, Colcell, width );
    //AddColumn(OI, "Current OI", 1, Colfont, Colcell, width );
    //AddColumn(Ref(OI,-1), "yOI", 1.1, Colfont, Colcell, width );

    AddColumn( CngOI, "OIChange%", 1.2, Colfont, Colcell, width );

    // Explorer to locate the price in CAM weekly levels

    priceAboveH4 = C >= H4 ;
    priceBetween_H4_and_H3 = C<H4 AND C>H3 ;
    priceBetween_H3_and_R1 = C<H3 AND C>R1 ;

    priceBelowL4 = C <= L4 ;
    priceBetween_L4_and_L3 = C > L4 AND C < L3 ;
    priceBetween_L3_and_S1 = C >= L3 AND C <= S1 ;

    CamrillaZone = WriteIf( priceAboveH4, "Breakout", WriteIf( priceBetween_H4_and_H3, "Between H3 & H4",
                       WriteIf( priceBetween_H3_and_R1, "Between H1 & H3", WriteIf( priceBelowL4, "<L4",
                                WriteIf( priceBetween_L4_and_L3, "Between L3 & L4",
                                         WriteIf( priceBetween_L3_and_S1, "Between L3 & L1", "UNKNOWN" ) ) ) ) ) );

    AddTextColumn( CamrillaZone, "Camrilla Zone", 10, Colfont2, Colcell, width );
    

    // Open Interest and Price Rules


    longBuidlup = Cng > 0 AND CngOI > 0;
    longUnwind = Cng < 0 AND CngOI < 0;
    ShortBuildUp = Cng<0 AND CngOI>0;
    ShortCovering = Cng > 0 AND CngOI < 0;
    

    FutureOI = WriteIf( longBuidlup, "LongBuild", WriteIf( longUnwind, "longUnwind", WriteIf( ShortBuildUp, "ShortBuildUp", WriteIf( ShortCovering, "ShortCovering", "Error" ) ) ) );

    AddTextColumn( FutureOI, "FutureOI", 10, Colfont4, Colcell, width );

    //AddSummaryRows( 63, format );
}

Filter = 1; // Status( "lastbarinrange" ); etc...




  1. I am setting up alerts - I need to know is there a default code to run and see the alert work when markets are closed. I need to test out the feature. what is the best way to do so?

  2. Easy Alert- I have having trouble setting this one up aswell. After adding the symbol, it still show black in the alert list.

image

This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.