2885 Holy Grail

download 2885 Holy Grail

of 23

  • date post

    05-Jul-2018
  • Category

    Documents

  • view

    212
  • download

    0

Embed Size (px)

Transcript of 2885 Holy Grail

  • 8/15/2019 2885 Holy Grail

    1/23

       _SECTION_BEGIN("PRASAD SYSTEMS"); Param("DEDICATED TO MY FATHER",5);

     _SECTION_END();

     _SECTION_BEGIN("BACK COLR"); SetChartBkColor( ParamColor("Chart Color", colorBlack)); SetChartOptions(0,chartShowArrows|chartShowDates); GfxSetOverlayMode(1); GfxSelectFont("Tahoma", Status("pxheight")/13 ); GfxSetTextAlign( 6 );// center alignment GfxSetTextColor( ParamColor("Text Color", ColorHSB( 42, 42, 42 ) )); GfxSetBkMode(0); // transparent GfxTextOut( Name(), Status("pxwidth")/2, Status("pxheight")/7);

    GfxSelectFont("Tahoma", Status("pxheight")/17 ); GfxTextOut( "HOLY GRAIL", Status("pxwidth")/2, Status("pxheight")/2.6 );

    GfxSelectFont("Tahoma", Status("pxheight")/30 ); GfxTextOut( "prasad9rao@gmail.com", Status("pxwidth")/2, Status("pxheight")/2.1) ;

    GfxSelectFont("Arial Bold", Status("pxheight")/15); GfxTextOut( "PRASAD ANALYSTIC ver 5", Status("pxwidth")/2, Status("pxheight")/20

    ); _SECTION_END();

    GfxSetTextColor(ColorRGB(200, 150, 100) ); GfxSelectFont("Arial BOLD", Status("pxheight")/60);  GfxTextOut( "Dedicated to My Father : BALKRISHNA RAO",Status("pxwidth")/5, Stat us("pxheight")/1.06);

    SetBarFillColor( IIf(O>C,ColorRGB(217,0,0),ColorRGB(1,149,38)) ); Plot( C, "Price", IIf( O>C,ColorRGB(255,208,82), ColorRGB(255,255,255)), styleCa ndle );

    /******************FIXED TITLES**************/

    Chg=Ref(C,-1);Title = EncodeColor(colorYellow)+ "Company :: " +Title = Name() + " " + Encod eColor(colorLightOrange) + "Date :: " + Date() +EncodeColor(11) + EncodeColor(c olorWhite) + "\n{{INTERVAL}} " +   EncodeColor(55)+ " Open: "+ EncodeColor(colorWhite)+ WriteVal(O,format=1.2 ) +

    EncodeColor(55)+ " High: "+ EncodeColor(colorWhite) + WriteVal(H,format=1. 2) +   EncodeColor(55)+ " Low: "+ EncodeColor(colorWhite)+ WriteVal(L,format=1.2)  +

    EncodeColor(55)+ " Close: "+ WriteIf(C> Chg,EncodeColor(colorBrightGreen), EncodeColor(colorRed))+ WriteVal(C,format=1.2)+

    EncodeColor(55)+ " Change: "+ WriteIf(C> Chg,EncodeColor(colorBrightGreen)

    ,EncodeColor(colorRed))+ WriteVal(ROC(C,1),format=1.2)+ "%"+   EncodeColor(55)+ " Volume: "+ EncodeColor(colorWhite)+ WriteVal(V,1);

    /************************************************************   SUPPORTS & RESISTANCE *************************************************************/

  • 8/15/2019 2885 Holy Grail

    2/23

    HaClose =EMA((O+H+L+C)/4,3); HaOpen = AMA( Ref( HaClose, -1 ), 0.5 ); HaHigh = Max( H, Max( HaClose, HaOpen ) ); HaLow = Min( L, Min( HaClose, HaOpen ) );

     _SECTION_BEGIN("Support and Resistance");

    supres=ParamToggle("Display(ON - OFF)","Off|On",0); if(supres) {

    Prd1=Param("Resistance Period",2,0,200,1);   test = TEMA ( High , Prd1 ) ;

    PK = test > Ref(test,-1) AND Ref(test,1) < High;//Peak PKV0 = ValueWhen(PK,haHigh,0);//PeakValue0 PKV1 = ValueWhen(PK,haHigh,1);//PeakValue1 PKV2 = ValueWhen(PK,haHigh,2);//PeakValue2

    MPK = PKV2 < PKV1 AND PKV1 > PKV0 ;//MajorPeak

    MPKV = ValueWhen(Ref(MPK,-1) == 0 AND MPK == 1, PKV1,1); //MajorPeakValueMPKD = ValueWhen(Ref(MPK,-1) == 0 AND MPK == 1, DateNum(),1); //MajorPeakDate SD = IIf(DateNum() < LastValue(MPKD,lastmode = True ), Null, LastValue(MPKV,Last mode = True));//SelectedDate Plot(SD, "Resist1", colorDarkRed,styleDots|styleDashed|styleThick|styleNoTitle ,maskAll);

    MPKV2 = ValueWhen(Ref(MPK,-1) == 0 AND MPK == 1, PKV1,2); //MajorPeakValue MPKD2 = ValueWhen(Ref(MPK,-1) == 0 AND MPK == 1, DateNum(),2); //MajorPeakDate SD2 = IIf(DateNum() < LastValue(MPKD2,lastmode = True ), Null, LastValue(MPKV2,L astmode = True));//SelectedDate Plot(SD2, "Resist2", colorDarkRed,styleDots|styleDashed|styleThick|styleNoTitl

    e,maskAll);

    MPKV3 = ValueWhen(Ref(MPK,-1) == 0 AND MPK == 1, PKV1,3); //MajorPeakValue MPKD3 = ValueWhen(Ref(MPK,-1) == 0 AND MPK == 1, DateNum(),3); //MajorPeakDate SD3 = IIf(DateNum() < LastValue(MPKD3,lastmode = True ), Null, LastValue(MPKV3,L astmode = True));//SelectedDate Plot(SD3, "Resist3", colorDarkRed,styleDots|styleDashed|styleThick|styleNoTitle ,maskAll);

    MPKV4 = ValueWhen(Ref(MPK,-1) == 0 AND MPK == 1, PKV1,4); //MajorPeakValue MPKD4 = ValueWhen(Ref(MPK,-1) == 0 AND MPK == 1, DateNum(),4); //MajorPeakDate SD4 = IIf(DateNum() < LastValue(MPKD4,lastmode = True ), Null, LastValue(MPKV4,L astmode = True));//SelectedDate Plot(SD4, "Resist4", colorDarkRed,styleDots|styleDashed|styleThick|styleNoTitl e,maskAll);

  • 8/15/2019 2885 Holy Grail

    3/23

    MPKV5 = ValueWhen(Ref(MPK,-1) == 0 AND MPK == 1, PKV1,5); //MajorPeakValue MPKD5 = ValueWhen(Ref(MPK,-1) == 0 AND MPK == 1, DateNum(),5); //MajorPeakDate SD5 = IIf(DateNum() < LastValue(MPKD5,lastmode = True ), Null, LastValue(MPKV5,L astmode = True));//SelectedDate Plot(SD5, "Resist5", colorDarkRed,styleDots|styleDashed|styleThick|styleNoTitl e,maskAll);

    MPKV6 = ValueWhen(Ref(MPK,-1) == 0 AND MPK == 1, PKV1,6); //MajorPeakValue MPKD6 = ValueWhen(Ref(MPK,-1) == 0 AND MPK == 1, DateNum(),6); //MajorPeakDate SD6 = IIf(DateNum() < LastValue(MPKD6,lastmode = True ), Null, LastValue(MPKV6,L astmode = True));//SelectedDate Plot(SD6, "Resist6", colorDarkRed,styleDots|styleDashed|styleThick|styleNoTitle, maskAll);

    //SP=L > Ref(L,-1) AND Ref(L,1) < L;//Peak

    Prd2=Param("Suppport Period",2,0,200,1);  

    test2 = TEMA ( Low , Prd2 ) ;

    SP = Ref(test2,1) > Low AND test2 < Ref(test2,-1);//Peak SPV0 = ValueWhen(SP,haLow,0);//PeakValue0 SPV1 = ValueWhen(SP,haLow,1);//PeakValue1 SPV2 = ValueWhen(SP,haLow,2);//PeakValue2

    //PKV5 = ValueWhen(PK,haHigh,5);//PeakValue5 //PKV6 = ValueWhen(PK,haHigh,6);//PeakValue6

    MSP = SPV2 > SPV1 AND SPV1 < SPV0 ;//MajorPeak

    MSPV = ValueWhen(Ref(MSP,-1) == 0 AND MSP == 1, SPV1,1);

    MSPD = ValueWhen(Ref(MSP,-1) == 0 AND MSP == 1, DateNum(),1);SD = IIf(DateNum() < LastValue(MSPD,lastmode = True ), Null, LastValue(MSPV,Last mode = True)); Plot(SD,"Support1", colorYellow,styleDots|styleDashed|styleThick|styleNoTitle,m askAll);

    MSPV2 = ValueWhen(Ref(MSP,-1) == 0 AND MSP == 1, SPV1,2); MSPD2 = ValueWhen(Ref(MSP,-1) == 0 AND MSP == 1, DateNum(),2); SD2 = IIf(DateNum() < LastValue(MSPD2,lastmode = True ), Null, LastValue(MSPV2,L astmode = True)); Plot(SD2,"Support2", colorYellow,styleDots|styleDashed|styleThick|styleNoTitle,

    maskAll);

    MSPV3 = ValueWhen(Ref(MSP,-1) == 0 AND MSP == 1, SPV1,3); MSPD3 = ValueWhen(Ref(MSP,-1) == 0 AND MSP == 1, DateNum(),3); SD3 = IIf(DateNum() < LastValue(MSPD3,lastmode = True ), Null, LastValue(MSPV3,L astmode = True)); Plot(SD3,"Support3", colorYellow,styleDots|styleDashed|styleThick|styleNoTitle,m

  • 8/15/2019 2885 Holy Grail

    4/23

    askAll);

    MSPV4 = ValueWhen(Ref(MSP,-1) == 0 AND MSP == 1, SPV1,4); MSPD4 = ValueWhen(Ref(MSP,-1) == 0 AND MSP == 1, DateNum(),4); SD4 = IIf(DateNum() < LastValue(MSPD4,lastmode = True ), Null, LastValue(MSPV4,L astmode = True)); Plot(SD4,"Support4", colorYellow,styleDots|styleDashed|styleThick|styleNoTitle, maskAll);

    MSPV5 = ValueWhen(Ref(MSP,-1) == 0 AND MSP == 1, SPV1,5); MSPD5 = ValueWhen(Ref(MSP,-1) == 0 AND MSP == 1, DateNum(),5); SD5 = IIf(DateNum() < LastValue(MSPD5,lastmode = True ), Null, LastValue(MSPV5,L astmode = True)); Plot(SD5,"Support5", colorYellow,styleDots|styleDashed|styleThick|styleNoTitle, maskAll);

    MSPV6 = ValueWhen(Ref(MSP,-1) == 0 AND MSP == 1, SPV1,6); MSPD6 = ValueWhen(Ref(MSP,-1) == 0 AND MSP == 1, DateNum(),6);

    SD6 = IIf(DateNum() < LastValue(MSPD6,lastmode = True ), Null, LastValue(MSPV6,Lastmode = True)); Plot(SD6,"Support6", colorYellow,styleDots|styleDashed|styleThick|styleNoTitle,m askAll);

    }

     _SECTION_END();

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

    PIVOTS********************************** */

     _SECTION_BEGIN("PIVOT Average "); P = ParamField("Field"); Type = ParamList("Type", "Weighted,Lagless-21,Hull-26,Linear Regression-45,Expon ential,Double Exponential,Tripple Exponential,Wilders,Simple"); Periods = Param("Periods", 9, 2, 100 ); Displacement = Param("Displacement", 1, -50, 50 );

    m = 0;

    if( Type == "Weighted" ) m= WMA( P, Periods ); if( Type == "Lagless-21" ) m= 2*EMA(P, Periods)-EM A(EMA(P, Periods), Periods); if( Type == "Hull-26" ) m= WMA(2*(WMA(P, Period s/2))-WMA(P, Periods) ,4 ); if( Type == "Linear Regression-45" ) m= LinearReg( P, Periods ); if( Type == "Exponential" ) m = EMA( P, Periods ); if( Type == "Double Exponential" ) m = DEMA( P, Periods );

  • 8/15/2019 2885 Holy Grail

    5/23

    if( Type == "Tripple Exponential" ) m = TEMA( P, Periods ); if( Type == "Wilders" ) m = Wilders( P, Periods ); if( Type == "Simple" ) m = MA( P, Periods );

     _SECTION_BEGIN("Pivot Finder");

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

    Code to automatically identify pivots

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

    // -- what will be our lookback range for the hh and ll? farback=Param("How Far back to go",100,50,5000,10); nBars = Param("Number of bars", 12, 5, 40);

    "BIdxJJJ = " + BarIndex() +

    "\n" + "OGGGGGGGGGGG = " + O + "\n"+"H = "+ H + "\n"+"L = " + L

    + "\n"+"C " ;

    GraphXSpace=7;

    // -- Create 0-initialized arrays the size of barcount

    aHPivs = H - H;

    aLPivs = L - L;

    // -- More for future use, not necessary for basic plotting

    aHPivHighs = H - H;

    aLPivLows = L - L;

    aHPivIdxs = H - H;

    aLPivIdxs = L - L;

    nHPivs = 0;

    nLPivs = 0;

    lastHPIdx = 0;

    lastLPIdx = 0;

    lastHPH = 0;

    lastLPL = 0;

    curPivBarIdx = 0;

    aHHVBars = HHVBars(H, nBars)