pivot point formula

#2
hi
any body have pivot point formula for AmiBroker from Daily to yearly with
choice Choose from them ?

Super Pivot Points

Code:
_SECTION_BEGIN("pivots mw");
/***************************************/
/*SUPER PIVOT POINTS ver 1.3 day week month
by Avi b a
/***************************************/
/*
SUPER PIVOT POINTS can by used in 2 ways:
if you choose daily, the pivots are calculated from the previous day,
this can be used for daily charts.
the second option is next day for EOD charts.
for all the options available right click on the chart parameters.
to utilize all the program features you need amibroker from version 4.80.1 and
above.
enjoy!
*/
/*-----------------data------------------*/
SetChartBkColor(16 ) ;
k=IIf(ParamList("select type","daily|next day")=="daily",-1,0);
k1=-1;
TimeFrameSet(inDaily);
day_h= LastValue(Ref(H,K));
day_l= LastValue(Ref(L,K));
day_c= LastValue(Ref(C,K));
TimeFrameRestore();

TimeFrameSet(inWeekly);
Week_h= LastValue(Ref(H,K1));
Week_l= LastValue(Ref(L,K1));;
Week_c= LastValue(Ref(C,K1));;
TimeFrameRestore();

TimeFrameSet(inMonthly);
month_h= LastValue(Ref(H,K1));
month_l= LastValue(Ref(L,K1));
month_c= LastValue(Ref(C,K1));
TimeFrameRestore();

/*--------------------------------------*/
// day
DH=Day_h;
DL=Day_L;
DC=Day_C;

// DAY PIVOT Calculation
pd = ( DH+ DL + DC )/3;
sd1 = (2*pd)-DH;
sd2 = pd -(DH - DL);
sd3 = Sd1 - (DH-DL); 
rd1 = (2*pd)-DL;
rd2 = pd +(DH -DL);
rd3 = rd1 +(DH-DL);

// week
WH=Week_h;
WL=Week_l;
WC=Week_c;

// WEEK PIVOT Calculation
pw = ( WH+ WL + WC )/3;
sw1 = (2*pw)-WH;
sw2 = pw -(WH - WL);
sw3 = Sw1 - (WH-WL); 
rw1 = (2*pw)-WL;
rw2 = pw +(WH -WL);
rw3 = rw1 +(WH-WL);

// month
MH=month_h;
ML=month_l;
MC=month_c;

// MONTH PIVOT Calculation
pm = ( MH+ ML + MC )/3;
sm1 = (2*pm)-MH;
sm2 = pm -(MH - ML);
sm3 = Sm1 - (MH-ML); 
rm1 = (2*pm)-ML;
rm2 = pm +(MH -ML);
rm3 = rm1 +(MH-ML);

/*--------------------------------------*/
// PARAMETERS
slide =  Param("slide all",33,-1000,1000,1);
slide1 = Param("slide_day",50,0,1000,1);
slide2 = Param("slide_week",70,0,1000,1);
slide3 = Param("slide_month",90,0,1000,1);
slide_Hight =  Param("slide_Hight",0,-1000,1000,1);


SHALD = ParamList("daily Pivots", "all|selected only|hide" );
SHALW = ParamList("weekly Pivots", "selected only|all|hide" );
SHALM = ParamList("monthly Pivots", "selected only|all|hide" ); 

//day
PDP = ParamList("DP",   "SHOW|HIDE" ); 
PDR1 = ParamList("DR1", "SHOW|HIDE" ); 
PDR2 = ParamList("DR2", "HIDE|SHOW"  ); 
PDR3 = ParamList("DR3", "HIDE|SHOW" ); 

PDS1 = ParamList("DS1", "SHOW|HIDE" ); 
PDS2 = ParamList("DS2", "HIDE|SHOW" ); 
PDS3 = ParamList("DS3", "HIDE|SHOW" ); 


//week
PWP = ParamList("WP", "SHOW|HIDE" ); 
PWR1 = ParamList("WR1", "SHOW|HIDE" ); 
PWR2 = ParamList("WR2", "HIDE|SHOW" ); 
PWR3 = ParamList("WR3", "HIDE|SHOW" ); 

PWS1 = ParamList("WS1", "SHOW|HIDE" ); 
PWS2 = ParamList("WS2", "HIDE|SHOW" ); 
PWS3 = ParamList("WS3", "HIDE|SHOW" ); 

//month
PMP = ParamList("MP",   "SHOW|HIDE" ); 
PMR1 = ParamList("MR1", "SHOW|HIDE" ); 
PMR2 = ParamList("MR2", "HIDE|SHOW"  ); 
PMR3 = ParamList("MR3", "HIDE|SHOW" ); 

PMS1 = ParamList("MS1", "SHOW|HIDE" ); 
PMS2 = ParamList("MS2", "HIDE|SHOW" ); 
PMS3 = ParamList("MS3", "HIDE|SHOW" ); 

DayCOLOR = 34;
weekCOLOR =10; 
monthCOLOR =42;
/*--------------------------------------*/
// LABELS
for( i = 0; i < BarCount; i++ ) 
{
 //day
 if(i+slide1== BarCount && (PDP=="SHOW" OR SHALD=="all") && SHALD!="hide")
PlotText( "daily Pivot  "+pd ,i+slide,pd+slide_Hight ,DayCOLOR);
 if(i+slide1== BarCount && (PDR1=="SHOW" OR SHALD=="all")&& SHALD!="hide")
PlotText( "daily R1  "+rd1 ,i+slide,rd1+slide_Hight ,DayCOLOR  ); 
 if(i+slide1== BarCount && (PDR2=="SHOW" OR SHALD=="all")&& SHALD!="hide")
PlotText( "daily R2 "+rd2 ,i+slide,rd2+slide_Hight ,DayCOLOR  );
 if(i+slide1== BarCount && (PDR3=="SHOW" OR SHALD=="all")&& SHALD!="hide")
PlotText( "daily R3 "+rd3 ,i+slide,rd3+slide_Hight ,DayCOLOR  );

 if(i+slide1== BarCount && (PDS1=="SHOW" OR SHALD=="all")&& SHALD!="hide")
PlotText( "daily  S1 "+sd1 ,i+slide,sd1+slide_Hight ,DayCOLOR  );
 if(i+slide1== BarCount && (PDS2=="SHOW" OR SHALD=="all")&& SHALD!="hide")
PlotText( "daily  S2 "+sd2 ,i+slide,sd2+slide_Hight ,DayCOLOR  );
 if(i+slide1== BarCount && (PDS3=="SHOW" OR SHALD=="all")&& SHALD!="hide")
PlotText( "daily  S3 "+sd3 ,i+slide,sd3+slide_Hight ,DayCOLOR  );

 //week
 if(i+slide2== BarCount && (PWP=="SHOW"  OR SHALW=="all")&& SHALW!="hide")
PlotText( "weekly Pivot  "+pw ,i+slide,pw+slide_Hight ,weekCOLOR );
 if(i+slide2== BarCount && (PWR1=="SHOW" OR SHALW=="all")&& SHALW!="hide")
PlotText( "weekly R1  "+rw1 ,i+slide,rw1+slide_Hight ,weekCOLOR ); 
 if(i+slide2== BarCount && (PWR2=="SHOW" OR SHALW=="all")&& SHALW!="hide")
PlotText( "weekly R2 "+rw2 ,i+slide,rw2+slide_Hight ,weekCOLOR );
 if(i+slide2== BarCount && (PWR3=="SHOW" OR SHALW=="all")&& SHALW!="hide")
PlotText( "weekly R3 "+rw3 ,i+slide,rw3+slide_Hight ,weekCOLOR );

 if(i+slide2== BarCount && (PWS1=="SHOW" OR SHALW=="all")&& SHALW!="hide")
PlotText( "weekly S1 "+sw1 ,i+slide,sw1+slide_Hight ,weekCOLOR );
 if(i+slide2== BarCount && (PWS2=="SHOW" OR SHALW=="all")&& SHALW!="hide")
PlotText( "weekly S2 "+sw2 ,i+slide,sw2+slide_Hight ,weekCOLOR );
 if(i+slide2== BarCount && (PWS3=="SHOW" OR SHALW=="all")&& SHALW!="hide")
PlotText( "weekly S3 "+sw3 ,i+slide,sw3+slide_Hight ,weekCOLOR );
 //month 
 if(i+slide3== BarCount && (PMP=="SHOW"  OR SHALM=="all")&& SHALM!="hide")
PlotText( "monthly Pivot  "+pm ,i+slide,Pm+slide_Hight ,monthCOLOR );
 if(i+slide3== BarCount && (PMR1=="SHOW" OR SHALM=="all")&& SHALM!="hide")
PlotText( "monthly R1 "+rm1 ,i+slide,rm1+slide_Hight ,monthCOLOR );
 if(i+slide3== BarCount && (PMR2=="SHOW" OR SHALM=="all")&& SHALM!="hide")
PlotText( "monthly R2 "+rm2 ,i+slide,rm2+slide_Hight ,monthCOLOR );
 if(i+slide3== BarCount && (PMR3=="SHOW" OR SHALM=="all")&& SHALM!="hide")
PlotText( "monthly R3 "+rm3 ,i+slide,rm3+slide_Hight ,monthCOLOR );

 if(i+slide3== BarCount && (PMS1=="SHOW" OR SHALM=="all")&&
SHALM!="hide")PlotText( "monthly S1 "+sm1 ,i+slide,sm1+slide_Hight
,monthCOLOR);
 if(i+slide3== BarCount && (PMS2=="SHOW" OR SHALM=="all")&& SHALM!="hide")
PlotText( "monthly S2 "+sm2 ,i+slide,sm2+slide_Hight ,monthCOLOR );
 if(i+slide3== BarCount && (PMS3=="SHOW" OR SHALM=="all")&& SHALM!="hide")
PlotText( "monthly S3 "+sm3 ,i+slide,sm3+slide_Hight ,monthCOLOR );
}
/*--------------------------------------*/
// PLOTS
 style = IIf(ParamList("Chart style",
"styleCandle|styleBar")=="styleCandle",64,128);
 Plot (C,Date ()+" close",11,style);
 //day
 if ((PDP=="SHOW" OR SHALD=="all")  && SHALD!="hide") Plot (pd,"daily Pivot
",DayCOLOR,1);
 if ((PDR1=="SHOW" OR SHALD=="all") && SHALD!="hide") Plot (rd1,"daily R1
",DayCOLOR,32);
 if ((PDR2=="SHOW" OR SHALD=="all") && SHALD!="hide") Plot (rd2,"daily R2
",DayCOLOR,32);
 if ((PDR3=="SHOW" OR SHALD=="all") && SHALD!="hide") Plot (rd3,"daily R3
",DayCOLOR,32);

 if ((PDS1=="SHOW" OR SHALD=="all") && SHALD!="hide") Plot (sd1,"daily S1
",DayCOLOR,32);
 if ((PDS2=="SHOW" OR SHALD=="all") && SHALD!="hide") Plot (Sd2,"daily S2
",DayCOLOR,32);
 if ((PDS3=="SHOW" OR SHALD=="all") && SHALD!="hide") Plot (Sd3,"daily S3
",DayCOLOR,32);

//week
 if ((PWP=="SHOW"  OR SHALW=="all") && SHALW!="hide") Plot (pW,"weekly Pivot
",weekCOLOR,1);
 if ((PWR1=="SHOW" OR SHALW=="all") && SHALW!="hide") Plot (rw1,"weekly R1
",weekCOLOR,32);
 if ((PWR2=="SHOW" OR SHALW=="all") && SHALW!="hide") Plot (rw2,"weekly R2
",weekCOLOR,32);
 if ((PWR3=="SHOW" OR SHALW=="all") && SHALW!="hide") Plot (rw3,"weekly R3
",weekCOLOR,32);

 if ((PWS1=="SHOW" OR SHALW=="all") && SHALW!="hide") Plot (sw1,"weekly S1
",weekCOLOR,32);
 if ((PWS2=="SHOW" OR SHALW=="all") && SHALW!="hide") Plot (Sw2,"weekly S2
",weekCOLOR,32);
 if ((PWS3=="SHOW" OR SHALW=="all") && SHALW!="hide") Plot (Sw3,"weekly S3
",weekCOLOR,32);

 //month
 if ((PMP=="SHOW"  OR SHALM=="all") && SHALM!="hide") Plot (pm,"monthly
Pivot",monthCOLOR ,1);
 if ((PMR1=="SHOW" OR SHALM=="all") && SHALM!="hide") Plot (rm1,"monthly
R1",monthCOLOR ,32);
 if ((PMR2=="SHOW" OR SHALM=="all") && SHALM!="hide") Plot (rm2,"monthly
R2",monthCOLOR ,32);
 if ((PMR3=="SHOW" OR SHALM=="all") && SHALM!="hide") Plot (rm3,"monthly
R3",monthCOLOR ,32);

 if ((PMS1=="SHOW" OR SHALM=="all") && SHALM!="hide") Plot (sm1,"monthly
S1",monthCOLOR ,32);
 if ((PMS2=="SHOW" OR SHALM=="all") && SHALM!="hide") Plot (sm2,"monthly
S2",monthCOLOR ,32);
 if ((PMS3=="SHOW" OR SHALM=="all") && SHALM!="hide") Plot (sm3,"monthly
S3",monthCOLOR ,32);
/*--------------------------------------*/
// TEXT
"high  = "+H;
"low   =  "+L;
"close = "+C;
_SECTION_END();

_SECTION_BEGIN("Name");
GfxSetOverlayMode(0);
GfxSelectFont("Tahoma", Status("pxheight")/8 );
GfxSetTextAlign( 6 );
GfxSetTextColor( ColorHSB( 42, 42, 42 ) );
GfxSetBkMode(0);
GfxTextOut( Name(), Status("pxwidth")/2, Status("pxheight")/12 );
GfxSelectFont("Tahoma", Status("pxheight")/18 );
GfxTextOut( IndustryID(1), Status("pxwidth")/2, Status("pxheight")/4 );

GfxSelectFont("Tahoma", Status("pxheight")/18 );
GfxSelectFont("Tahoma", Status("pxheight")/36 );
GfxTextOut( "Ashraf Samir", Status("pxwidth")/2, Status("pxheight")/3 );
_SECTION_END();
 
#3
Super Pivot Points

Code:
_SECTION_BEGIN("pivots mw");
/***************************************/
/*SUPER PIVOT POINTS ver 1.3 day week month
by Avi b a
/***************************************/
/*
SUPER PIVOT POINTS can by used in 2 ways:
if you choose daily, the pivots are calculated from the previous day,
this can be used for daily charts.
the second option is next day for EOD charts.
for all the options available right click on the chart parameters.
to utilize all the program features you need amibroker from version 4.80.1 and
above.
enjoy!
*/
/*-----------------data------------------*/
SetChartBkColor(16 ) ;
k=IIf(ParamList("select type","daily|next day")=="daily",-1,0);
k1=-1;
TimeFrameSet(inDaily);
day_h= LastValue(Ref(H,K));
day_l= LastValue(Ref(L,K));
day_c= LastValue(Ref(C,K));
TimeFrameRestore();

TimeFrameSet(inWeekly);
Week_h= LastValue(Ref(H,K1));
Week_l= LastValue(Ref(L,K1));;
Week_c= LastValue(Ref(C,K1));;
TimeFrameRestore();

TimeFrameSet(inMonthly);
month_h= LastValue(Ref(H,K1));
month_l= LastValue(Ref(L,K1));
month_c= LastValue(Ref(C,K1));
TimeFrameRestore();

/*--------------------------------------*/
// day
DH=Day_h;
DL=Day_L;
DC=Day_C;

// DAY PIVOT Calculation
pd = ( DH+ DL + DC )/3;
sd1 = (2*pd)-DH;
sd2 = pd -(DH - DL);
sd3 = Sd1 - (DH-DL); 
rd1 = (2*pd)-DL;
rd2 = pd +(DH -DL);
rd3 = rd1 +(DH-DL);

// week
WH=Week_h;
WL=Week_l;
WC=Week_c;

// WEEK PIVOT Calculation
pw = ( WH+ WL + WC )/3;
sw1 = (2*pw)-WH;
sw2 = pw -(WH - WL);
sw3 = Sw1 - (WH-WL); 
rw1 = (2*pw)-WL;
rw2 = pw +(WH -WL);
rw3 = rw1 +(WH-WL);

// month
MH=month_h;
ML=month_l;
MC=month_c;

// MONTH PIVOT Calculation
pm = ( MH+ ML + MC )/3;
sm1 = (2*pm)-MH;
sm2 = pm -(MH - ML);
sm3 = Sm1 - (MH-ML); 
rm1 = (2*pm)-ML;
rm2 = pm +(MH -ML);
rm3 = rm1 +(MH-ML);

/*--------------------------------------*/
// PARAMETERS
slide =  Param("slide all",33,-1000,1000,1);
slide1 = Param("slide_day",50,0,1000,1);
slide2 = Param("slide_week",70,0,1000,1);
slide3 = Param("slide_month",90,0,1000,1);
slide_Hight =  Param("slide_Hight",0,-1000,1000,1);


SHALD = ParamList("daily Pivots", "all|selected only|hide" );
SHALW = ParamList("weekly Pivots", "selected only|all|hide" );
SHALM = ParamList("monthly Pivots", "selected only|all|hide" ); 

//day
PDP = ParamList("DP",   "SHOW|HIDE" ); 
PDR1 = ParamList("DR1", "SHOW|HIDE" ); 
PDR2 = ParamList("DR2", "HIDE|SHOW"  ); 
PDR3 = ParamList("DR3", "HIDE|SHOW" ); 

PDS1 = ParamList("DS1", "SHOW|HIDE" ); 
PDS2 = ParamList("DS2", "HIDE|SHOW" ); 
PDS3 = ParamList("DS3", "HIDE|SHOW" ); 


//week
PWP = ParamList("WP", "SHOW|HIDE" ); 
PWR1 = ParamList("WR1", "SHOW|HIDE" ); 
PWR2 = ParamList("WR2", "HIDE|SHOW" ); 
PWR3 = ParamList("WR3", "HIDE|SHOW" ); 

PWS1 = ParamList("WS1", "SHOW|HIDE" ); 
PWS2 = ParamList("WS2", "HIDE|SHOW" ); 
PWS3 = ParamList("WS3", "HIDE|SHOW" ); 

//month
PMP = ParamList("MP",   "SHOW|HIDE" ); 
PMR1 = ParamList("MR1", "SHOW|HIDE" ); 
PMR2 = ParamList("MR2", "HIDE|SHOW"  ); 
PMR3 = ParamList("MR3", "HIDE|SHOW" ); 

PMS1 = ParamList("MS1", "SHOW|HIDE" ); 
PMS2 = ParamList("MS2", "HIDE|SHOW" ); 
PMS3 = ParamList("MS3", "HIDE|SHOW" ); 

DayCOLOR = 34;
weekCOLOR =10; 
monthCOLOR =42;
/*--------------------------------------*/
// LABELS
for( i = 0; i < BarCount; i++ ) 
{
 //day
 if(i+slide1== BarCount && (PDP=="SHOW" OR SHALD=="all") && SHALD!="hide")
PlotText( "daily Pivot  "+pd ,i+slide,pd+slide_Hight ,DayCOLOR);
 if(i+slide1== BarCount && (PDR1=="SHOW" OR SHALD=="all")&& SHALD!="hide")
PlotText( "daily R1  "+rd1 ,i+slide,rd1+slide_Hight ,DayCOLOR  ); 
 if(i+slide1== BarCount && (PDR2=="SHOW" OR SHALD=="all")&& SHALD!="hide")
PlotText( "daily R2 "+rd2 ,i+slide,rd2+slide_Hight ,DayCOLOR  );
 if(i+slide1== BarCount && (PDR3=="SHOW" OR SHALD=="all")&& SHALD!="hide")
PlotText( "daily R3 "+rd3 ,i+slide,rd3+slide_Hight ,DayCOLOR  );

 if(i+slide1== BarCount && (PDS1=="SHOW" OR SHALD=="all")&& SHALD!="hide")
PlotText( "daily  S1 "+sd1 ,i+slide,sd1+slide_Hight ,DayCOLOR  );
 if(i+slide1== BarCount && (PDS2=="SHOW" OR SHALD=="all")&& SHALD!="hide")
PlotText( "daily  S2 "+sd2 ,i+slide,sd2+slide_Hight ,DayCOLOR  );
 if(i+slide1== BarCount && (PDS3=="SHOW" OR SHALD=="all")&& SHALD!="hide")
PlotText( "daily  S3 "+sd3 ,i+slide,sd3+slide_Hight ,DayCOLOR  );

 //week
 if(i+slide2== BarCount && (PWP=="SHOW"  OR SHALW=="all")&& SHALW!="hide")
PlotText( "weekly Pivot  "+pw ,i+slide,pw+slide_Hight ,weekCOLOR );
 if(i+slide2== BarCount && (PWR1=="SHOW" OR SHALW=="all")&& SHALW!="hide")
PlotText( "weekly R1  "+rw1 ,i+slide,rw1+slide_Hight ,weekCOLOR ); 
 if(i+slide2== BarCount && (PWR2=="SHOW" OR SHALW=="all")&& SHALW!="hide")
PlotText( "weekly R2 "+rw2 ,i+slide,rw2+slide_Hight ,weekCOLOR );
 if(i+slide2== BarCount && (PWR3=="SHOW" OR SHALW=="all")&& SHALW!="hide")
PlotText( "weekly R3 "+rw3 ,i+slide,rw3+slide_Hight ,weekCOLOR );

 if(i+slide2== BarCount && (PWS1=="SHOW" OR SHALW=="all")&& SHALW!="hide")
PlotText( "weekly S1 "+sw1 ,i+slide,sw1+slide_Hight ,weekCOLOR );
 if(i+slide2== BarCount && (PWS2=="SHOW" OR SHALW=="all")&& SHALW!="hide")
PlotText( "weekly S2 "+sw2 ,i+slide,sw2+slide_Hight ,weekCOLOR );
 if(i+slide2== BarCount && (PWS3=="SHOW" OR SHALW=="all")&& SHALW!="hide")
PlotText( "weekly S3 "+sw3 ,i+slide,sw3+slide_Hight ,weekCOLOR );
 //month 
 if(i+slide3== BarCount && (PMP=="SHOW"  OR SHALM=="all")&& SHALM!="hide")
PlotText( "monthly Pivot  "+pm ,i+slide,Pm+slide_Hight ,monthCOLOR );
 if(i+slide3== BarCount && (PMR1=="SHOW" OR SHALM=="all")&& SHALM!="hide")
PlotText( "monthly R1 "+rm1 ,i+slide,rm1+slide_Hight ,monthCOLOR );
 if(i+slide3== BarCount && (PMR2=="SHOW" OR SHALM=="all")&& SHALM!="hide")
PlotText( "monthly R2 "+rm2 ,i+slide,rm2+slide_Hight ,monthCOLOR );
 if(i+slide3== BarCount && (PMR3=="SHOW" OR SHALM=="all")&& SHALM!="hide")
PlotText( "monthly R3 "+rm3 ,i+slide,rm3+slide_Hight ,monthCOLOR );

 if(i+slide3== BarCount && (PMS1=="SHOW" OR SHALM=="all")&&
SHALM!="hide")PlotText( "monthly S1 "+sm1 ,i+slide,sm1+slide_Hight
,monthCOLOR);
 if(i+slide3== BarCount && (PMS2=="SHOW" OR SHALM=="all")&& SHALM!="hide")
PlotText( "monthly S2 "+sm2 ,i+slide,sm2+slide_Hight ,monthCOLOR );
 if(i+slide3== BarCount && (PMS3=="SHOW" OR SHALM=="all")&& SHALM!="hide")
PlotText( "monthly S3 "+sm3 ,i+slide,sm3+slide_Hight ,monthCOLOR );
}
/*--------------------------------------*/
// PLOTS
 style = IIf(ParamList("Chart style",
"styleCandle|styleBar")=="styleCandle",64,128);
 Plot (C,Date ()+" close",11,style);
 //day
 if ((PDP=="SHOW" OR SHALD=="all")  && SHALD!="hide") Plot (pd,"daily Pivot
",DayCOLOR,1);
 if ((PDR1=="SHOW" OR SHALD=="all") && SHALD!="hide") Plot (rd1,"daily R1
",DayCOLOR,32);
 if ((PDR2=="SHOW" OR SHALD=="all") && SHALD!="hide") Plot (rd2,"daily R2
",DayCOLOR,32);
 if ((PDR3=="SHOW" OR SHALD=="all") && SHALD!="hide") Plot (rd3,"daily R3
",DayCOLOR,32);

 if ((PDS1=="SHOW" OR SHALD=="all") && SHALD!="hide") Plot (sd1,"daily S1
",DayCOLOR,32);
 if ((PDS2=="SHOW" OR SHALD=="all") && SHALD!="hide") Plot (Sd2,"daily S2
",DayCOLOR,32);
 if ((PDS3=="SHOW" OR SHALD=="all") && SHALD!="hide") Plot (Sd3,"daily S3
",DayCOLOR,32);

//week
 if ((PWP=="SHOW"  OR SHALW=="all") && SHALW!="hide") Plot (pW,"weekly Pivot
",weekCOLOR,1);
 if ((PWR1=="SHOW" OR SHALW=="all") && SHALW!="hide") Plot (rw1,"weekly R1
",weekCOLOR,32);
 if ((PWR2=="SHOW" OR SHALW=="all") && SHALW!="hide") Plot (rw2,"weekly R2
",weekCOLOR,32);
 if ((PWR3=="SHOW" OR SHALW=="all") && SHALW!="hide") Plot (rw3,"weekly R3
",weekCOLOR,32);

 if ((PWS1=="SHOW" OR SHALW=="all") && SHALW!="hide") Plot (sw1,"weekly S1
",weekCOLOR,32);
 if ((PWS2=="SHOW" OR SHALW=="all") && SHALW!="hide") Plot (Sw2,"weekly S2
",weekCOLOR,32);
 if ((PWS3=="SHOW" OR SHALW=="all") && SHALW!="hide") Plot (Sw3,"weekly S3
",weekCOLOR,32);

 //month
 if ((PMP=="SHOW"  OR SHALM=="all") && SHALM!="hide") Plot (pm,"monthly
Pivot",monthCOLOR ,1);
 if ((PMR1=="SHOW" OR SHALM=="all") && SHALM!="hide") Plot (rm1,"monthly
R1",monthCOLOR ,32);
 if ((PMR2=="SHOW" OR SHALM=="all") && SHALM!="hide") Plot (rm2,"monthly
R2",monthCOLOR ,32);
 if ((PMR3=="SHOW" OR SHALM=="all") && SHALM!="hide") Plot (rm3,"monthly
R3",monthCOLOR ,32);

 if ((PMS1=="SHOW" OR SHALM=="all") && SHALM!="hide") Plot (sm1,"monthly
S1",monthCOLOR ,32);
 if ((PMS2=="SHOW" OR SHALM=="all") && SHALM!="hide") Plot (sm2,"monthly
S2",monthCOLOR ,32);
 if ((PMS3=="SHOW" OR SHALM=="all") && SHALM!="hide") Plot (sm3,"monthly
S3",monthCOLOR ,32);
/*--------------------------------------*/
// TEXT
"high  = "+H;
"low   =  "+L;
"close = "+C;
_SECTION_END();

_SECTION_BEGIN("Name");
GfxSetOverlayMode(0);
GfxSelectFont("Tahoma", Status("pxheight")/8 );
GfxSetTextAlign( 6 );
GfxSetTextColor( ColorHSB( 42, 42, 42 ) );
GfxSetBkMode(0);
GfxTextOut( Name(), Status("pxwidth")/2, Status("pxheight")/12 );
GfxSelectFont("Tahoma", Status("pxheight")/18 );
GfxTextOut( IndustryID(1), Status("pxwidth")/2, Status("pxheight")/4 );

GfxSelectFont("Tahoma", Status("pxheight")/18 );
GfxSelectFont("Tahoma", Status("pxheight")/36 );
GfxTextOut( "Ashraf Samir", Status("pxwidth")/2, Status("pxheight")/3 );
_SECTION_END();
yearly pivot ?!
 
#5
I havnt seen yearly pivot points...i know Daily,weekly and monthly which are commonly used by traders n investors.

Happy trading:thumb:


yearly camarilla pivot.

_SECTION_BEGIN("Price");
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
Plot( C, "Close", ParamColor("Color", colorBlack ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
_SECTION_END();





_SECTION_BEGIN("Camarilla");

//---- pivot points
yH = TimeFrameGetPrice("H", inYearly, -1); // high
yL = TimeFrameGetPrice("L", inYearly, -1); // low
yC = TimeFrameGetPrice("C", inYearly, -1); // close
yO = TimeFrameGetPrice("O", inYearly); // current yr open


//............camarilla pivots

H4 = ( (yH-yL) * (1.1/2) ) + yC;
H3 = ( (yH-yL) * (1.1/4) ) + yC;
H2 = ( (yH-yL) * (1.1/6) ) + yC;
H1 = ( (yH-yL) * (1.1/12) ) + yC;





L3 = yC - ( (yH-yL) * (1.1/4) ) ;
L4 = yC - ( (yH-yL) * (1.1/2) ) ;
L1 = yC - ( (yH-yL) * (1.1/12) );
L2 = yC - ( (yH-yL) * (1.1/6) ) ;


Plot(H4, "h4",colorRed,styleLine);
Plot(H3, "h3",colorRed,styleLine);
Plot(H2, "h2",colorViolet,styleLine);
Plot(H1, "h1",colorViolet,styleLine);

Plot(L4, "l4",colorRed,styleLine);
Plot(L3, "l3",colorRed,styleLine);
Plot(L2, "l2",colorViolet,styleLine);
Plot(L1, "l1",colorViolet,styleLine);
 
#6
yearly camarilla pivot.

_SECTION_BEGIN("Price");
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
Plot( C, "Close", ParamColor("Color", colorBlack ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
_SECTION_END();





_SECTION_BEGIN("Camarilla");

//---- pivot points
yH = TimeFrameGetPrice("H", inYearly, -1); // high
yL = TimeFrameGetPrice("L", inYearly, -1); // low
yC = TimeFrameGetPrice("C", inYearly, -1); // close
yO = TimeFrameGetPrice("O", inYearly); // current yr open


//............camarilla pivots

H4 = ( (yH-yL) * (1.1/2) ) + yC;
H3 = ( (yH-yL) * (1.1/4) ) + yC;
H2 = ( (yH-yL) * (1.1/6) ) + yC;
H1 = ( (yH-yL) * (1.1/12) ) + yC;





L3 = yC - ( (yH-yL) * (1.1/4) ) ;
L4 = yC - ( (yH-yL) * (1.1/2) ) ;
L1 = yC - ( (yH-yL) * (1.1/12) );
L2 = yC - ( (yH-yL) * (1.1/6) ) ;


Plot(H4, "h4",colorRed,styleLine);
Plot(H3, "h3",colorRed,styleLine);
Plot(H2, "h2",colorViolet,styleLine);
Plot(H1, "h1",colorViolet,styleLine);

Plot(L4, "l4",colorRed,styleLine);
Plot(L3, "l3",colorRed,styleLine);
Plot(L2, "l2",colorViolet,styleLine);
Plot(L1, "l1",colorViolet,styleLine);



Yh- YL = Yesterday high and yesterday low , Not yearly high or yearly Low


i havnt seen use of yearly pivots.
 

KelvinHand

Well-Known Member
#7
Yh- YL = Yesterday high and yesterday low , Not yearly high or yearly Low


i havnt seen use of yearly pivots.

The code is nothing wrong. yH & yL is just a representation.
He use TimeFrameGetPrice() and set to inYearly, so the the High and low is refer to the last year High and Low. Not Yesterday high and yesterday low.

You did not see yearly pivots does not mean you cannot do it. Kind for D,W,M analysis.

I do that before in a daily chart in amibroker and MT4 for experiment.
 

KelvinHand

Well-Known Member
#8
yearly camarilla pivot.

_SECTION_BEGIN("Price");
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
Plot( C, "Close", ParamColor("Color", colorBlack ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
_SECTION_END();




_SECTION_BEGIN("Camarilla");

//---- pivot points
yH = TimeFrameGetPrice("H", inYearly, -1); // high
yL = TimeFrameGetPrice("L", inYearly, -1); // low
yC = TimeFrameGetPrice("C", inYearly, -1); // close
yO = TimeFrameGetPrice("O", inYearly); // current yr open


//............camarilla pivots

H4 = ( (yH-yL) * (1.1/2) ) + yC;
H3 = ( (yH-yL) * (1.1/4) ) + yC;
H2 = ( (yH-yL) * (1.1/6) ) + yC;
H1 = ( (yH-yL) * (1.1/12) ) + yC;





L3 = yC - ( (yH-yL) * (1.1/4) ) ;
L4 = yC - ( (yH-yL) * (1.1/2) ) ;
L1 = yC - ( (yH-yL) * (1.1/12) );
L2 = yC - ( (yH-yL) * (1.1/6) ) ;


Plot(H4, "h4",colorRed,styleLine);
Plot(H3, "h3",colorRed,styleLine);
Plot(H2, "h2",colorViolet,styleLine);
Plot(H1, "h1",colorViolet,styleLine);

Plot(L4, "l4",colorRed,styleLine);
Plot(L3, "l3",colorRed,styleLine);
Plot(L2, "l2",colorViolet,styleLine);
Plot(L1, "l1",colorViolet,styleLine);

Hi ARV,
Since Yearly Pivot Point is not commonly use. You can create a standalone script by making use of this camarilla pivot format,
copy those pivot point formula (which are repetitive for daily, weekly,monthly) into new script for yearly pivot point.
Very easy.



If you are good, you can create a procedure to use for all timeframes, i had not test the following procedure yet. should work

/*
Input:
tf - timeframe. eg InYearly .... InMinute

ago - current (0) to past ( -1... )

Output:
Pivots
_CP, _R1,_S1, _R2, _S2, _R3, _S3;

Optional : High, Low... : add _HI, _LO

example:

PivotPoints( inDaily, -1) ;
Plot(_CP, "Central Pivot", colorRed);
....etc

PivotPoints( inWeekly, -1) ;
Plot(_CP, "Weekly Pivot", colorGreen);
....etc


*/
procedure PivotPoints( tf, ago)
{
global _CP, _R1,_S1, _R2, _S2, _R3, _S3;
Hi = TimeFrameGetPrice("H", tf, ago);
Lo = TimeFrameGetPrice("L", tf, ago);
Cl = TimeFrameGetPrice("C", tf, ago);

_CP = (Hi+ Lo + Cl )/3;
_S1 = 2*_CP-Hi;
_S2 = _CP -(Hi - Lo);
_S3 = _S1 - (Hi-Lo);
_R1 = 2*_CP-Lo;
_R2 = _CP +(Hi -Lo);
_R3 = _R1 +(Hi-Lo);

}

same for your camarilla pivot if you create yourself.
 
Last edited:
#9
Hi ARV,
Since Yearly Pivot Point is not commonly use. You can create a standalone script by making use of this camarilla pivot format,
copy those pivot point formula (which are repetitive for daily, weekly,monthly) into new script for yearly pivot point.
Very easy.



If you are good, you can create a procedure to use for all timeframes, i had not test the following procedure yet. should work

/*
Input:
tf - timeframe. eg InYearly .... InMinute

ago - current (0) to past ( -1... )

Output:
Pivots
_CP, _R1,_S1, _R2, _S2, _R3, _S3;

Optional : High, Low... : add _HI, _LO

example:

PivotPoints( inDaily, -1) ;
Plot(_CP, "Central Pivot", colorRed);
....etc

PivotPoints( inWeekly, -1) ;
Plot(_CP, "Weekly Pivot", colorGreen);
....etc


*/
procedure PivotPoints( tf, ago)
{
global _CP, _R1,_S1, _R2, _S2, _R3, _S3;
Hi = TimeFrameGetPrice("H", tf, ago);
Lo = TimeFrameGetPrice("L", tf, ago);
Cl = TimeFrameGetPrice("C", tf, ago);

_CP = (Hi+ Lo + Cl )/3;
_S1 = 2*_CP-Hi;
_S2 = _CP -(Hi - Lo);
_S3 = _S1 - (Hi-Lo);
_R1 = 2*_CP-Lo;
_R2 = _CP +(Hi -Lo);
_R3 = _R1 +(Hi-Lo);

}

same for your camarilla pivot if you create yourself.
Kevin,

I substitute y with W ,M,Q to get week month and quarterly pivots and plot them on different chart sheets ,simple and effective.
on NF eod charts see how nicely Yearly offers S/R.
 

KelvinHand

Well-Known Member
#10
Kelvinhand's MTF Pivot Lines

Kevin,

I substitute y with W ,M,Q to get week month and quarterly pivots and plot them on different chart sheets ,simple and effective.
on NF eod charts see how nicely Yearly offers S/R.
Well. You don't see the power.
..........................................


The previous super pivot points make it too difficult to port to other timeframe and hard to read.
I had make it section orientated.

The script below the parameters input are same in all sections. Parameters input remain as User Changeable.
To code your (eg. 4H) section copy and paste the previous session into new one, then rename

eg. 4Hours
_SECTION_BEGIN("Pivot Lines: H4");

then in the function ConvertToPeriod(s)
addin case "H4": 4*inHourly


Change the parameter inputs below the session begin


That all.








Code:
_SECTION_BEGIN("Pivot Lines: Common");
/***************************************
  MTF Pivot Lines - Dayly/Weekly/Monthly/Quarterly/Yearly
  Created by Kelvinhand 

  Added features:
   1. Plot Hi/Lo
   2. Plot Pivots
   3. Plot Camarilla 

 - Easy extension to 4H, 1H

****************************************/
procedure CalcPivotPoints( tf, ago, Lv)
{
global _CP, _R1,_S1, _R2, _S2, _R3, _S3, _Hi, _Lo;

TimeFrameSet(tf);

_Hi = Ref(H,ago);
_Lo = Ref(L,ago);
_Cl  = Ref(C,ago);

if (Lv)
{
   _Hi=LastValue(_Hi);
   _Lo=LastValue(_Lo);
   _Cl=LastValue(_Cl);
}


_CP = (_Hi+ _Lo + _Cl )/3;
_S1 = 2*_CP-_Hi;
_S2 = _CP -(_Hi - _Lo);
_S3 = _S1 - (_Hi- _Lo);
_R1 = 2*_CP- _Lo;
_R2 = _CP +(_Hi - _Lo);
_R3 = _R1 +(_Hi- _Lo);

TimeFrameRestore();

}


procedure CalcCamarilla( tf, ago, Lv)
{
global _H1, _H2, _H3, _H4, _L1, _L2, _L3, _L4;

TimeFrameSet(tf);

_Hi = Ref(H,ago);
_Lo = Ref(L,ago);
_Cl = Ref(C,ago);

if (Lv)
{
   _Hi=LastValue(_Hi);
   _Lo=LastValue(_Lo);
   _Cl=LastValue(_Cl);
}


_R = _Hi - _Lo;
_H4 =  _R * (1.1/2) + _Cl;
_H3 =  _R * (1.1/4) + _Cl;
_H2 =  _R * (1.1/6) +  _Cl;
_H1 =  _R * (1.1/12) + _Cl;


_L3 = _Cl -  _R * (1.1/4);
_L4 = _Cl -  _R * (1.1/2);
_L1 = _Cl -  _R * (1.1/12);
_L2 = _Cl -  _R * (1.1/6);

TimeFrameRestore();

}



function ExtractSectionTimeFrame(s)
{
   Pos = StrFind(s, ":");
   pos++; 
   s = StrRight(s, StrLen(s)- pos);
   return s;
}

function ConvertToPeriod(s)
{
  tf= 0;
  switch(s)
  {
     case "Daily": tf= inDaily; break;
		case "Weekly": tf= inWeekly; break;
		case "Monthly": tf= inMonthly; break;
		case "Quarterly": tf= inQuarterly; break;
     case "Yearly": tf= inYearly; break;

    default: tf=inDaily; break;

  }

 return tf;
}



k=IIf(ParamList("Select Type","Daily|Next day")=="Daily",-1,0);

/*--------------------------------------*/
// PARAMETERS



/*--------------------------------------*/
// PLOTS
 style = IIf(ParamList("Chart style", "styleCandle|styleBar")=="styleCandle",64,128);
 Plot (C,Date ()+" close",11,style);

_SECTION_END();


_SECTION_BEGIN("Pivot Lines: Daily");

Show_Type = ParamList("Show", "None|Pivots|Camarilla", 1);

Show_Pivots = False;
Show_Camarilla = False;

switch (Show_Type)
{
  case "Pivots":	
			Show_Pivots= True;
       Show_Camarilla=False;
			break;

  case "Camarilla":	
			Show_Pivots= False;
       Show_Camarilla=True;
			break;
      
}
Show_HiLo = ParamToggle("Show High/Low", "No|Yes", 0); 

CP_Show   = ParamToggle("Show CP", "No|Yes", 1); 
SR1_Show  = ParamToggle("Show R1/S1", "No|Yes", 1); 
SR2_Show  = ParamToggle("Show R2/S2", "No|Yes", 1); 
SR3_Show  = ParamToggle("Show R3/S3", "No|Yes", 1); 

XShift = Param("XShift",20,0,1000,1);
YShift = Param("YShift",0,-1000,1000,1);

m_Color = colorLime;

  s=ExtractSectionTimeFrame(_SECTION_NAME());
  tf = ConvertToPeriod(s);

  CalcPivotPoints( tf, k, True);

  XOffset= BarCount-1 - xShift;

 if (Show_HiLo)
 {

   Plot (_Hi ,"",m_Color,styleNoLabel|styleDashed);
   PlotText( s+" Hi: "+ NumToStr(_Hi,1.4), XOffset, _Hi+YShift ,m_COLOR);

   Plot (_Lo ,"",m_Color,styleNoLabel|styleDashed);
   PlotText( s+" Lo: "+ NumToStr(_Lo,1.4), XOffset, _Lo+YShift ,m_COLOR);
 }

  
 if (Show_Pivots)
 { 
   if (CP_Show) 
	 {	
		Plot (_CP,"",m_Color,styleNoLabel);
     PlotText( s+" CP: "+ NumToStr(_CP, 1.4), XOffset, _CP+YShift ,m_COLOR);
   }

   if (SR1_Show) 
   {
      Plot(_R1,"",m_Color,styleDashed|styleNoLabel);
		 PlotText( s+" R1: "+NumToStr(_R1, 1.4), XOffset, _R1+YShift,m_COLOR );

      Plot(_S1,"",m_Color,styleDashed|styleNoLabel);
      PlotText( s+" S1: "+NumToStr(_S1, 1.4), XOffset, _S1+YShift,m_COLOR );
      
      
   }
   if (SR2_Show) 
   {
      Plot(_R2,"",m_Color,styleDashed|styleNoLabel);
      PlotText( s+" R2: "+NumToStr(_R2, 1.4), XOffset, _R2+YShift,m_COLOR );	

		 Plot(_S2,"",m_Color,styleDashed|styleNoLabel); 	
      PlotText( s+" S2: "+NumToStr(_S2, 1.4), XOffset, _S2+YShift,m_COLOR );
	 }
   if (SR3_Show) 
	 {
		Plot (_R3,"",m_Color,styleDashed|styleNoLabel);
		PlotText( s+" R3: "+NumToStr(_R3, 1.4), XOffset, _R3+YShift,m_COLOR ); 

		Plot (_S3,"",m_Color,styleDashed|styleNoLabel);
     PlotText( s+" S3: "+NumToStr(_S3, 1.4), XOffset, _S3+YShift, m_COLOR );
    }

   
  }

  if (Show_Camarilla)
  {
    CalcCamarilla( tf, k, True);

    Plot (_H1,"",m_Color,styleNoLabel|styleDashed);
    PlotText( s+" H1: "+ NumToStr(_H1, 1.4), XOffset, _H1+YShift ,m_COLOR);

    Plot (_H2,"",m_Color,styleNoLabel|styleDashed);
    PlotText( s+" H2: "+ NumToStr(_H2, 1.4), XOffset, _H2+YShift ,m_COLOR);

    Plot (_H3,"",m_Color,styleNoLabel|styleDashed);
    PlotText( s+" H3: "+ NumToStr(_H3, 1.4), XOffset, _H3+YShift ,m_COLOR);

    Plot (_H4,"",m_Color,styleNoLabel|styleDashed);
    PlotText( s+" H4: "+ NumToStr(_H4, 1.4), XOffset, _H4+YShift ,m_COLOR);

    Plot (_L1,"",m_Color,styleNoLabel|styleDashed);
    PlotText( s+" L1: "+ NumToStr(_L1, 1.4), XOffset, _L1+YShift ,m_COLOR);

    Plot (_L2,"",m_Color,styleNoLabel|styleDashed);
    PlotText( s+" L2: "+ NumToStr(_L2, 1.4), XOffset, _L2+YShift ,m_COLOR);

    Plot (_L3,"",m_Color,styleNoLabel|styleDashed);
    PlotText( s+" L3: "+ NumToStr(_L3, 1.4), XOffset, _L3+YShift ,m_COLOR);

    Plot (_L4,"",m_Color,styleNoLabel|styleDashed);
    PlotText( s+" L4: "+ NumToStr(_L4,1.4),  XOffset, _L4+YShift ,m_COLOR);

  }
_SECTION_END();


_SECTION_BEGIN("Pivot Lines: Weekly");

Show_Type = ParamList("Show", "None|Pivots|Camarilla", 1);

Show_Pivots = False;
Show_Camarilla = False;

switch (Show_Type)
{
  case "Pivots":	
			Show_Pivots= True;
       Show_Camarilla=False;
			break;

  case "Camarilla":	
			Show_Pivots= False;
       Show_Camarilla=True;
			break;
      
}

Show_HiLo = ParamToggle("Show High/Low", "No|Yes", 0); 
CP_Show   = ParamToggle("Show CP", "No|Yes", 1); 
SR1_Show  = ParamToggle("Show R1/S1", "No|Yes", 1); 
SR2_Show  = ParamToggle("Show R2/S2", "No|Yes", 1); 
SR3_Show  = ParamToggle("Show R3/S3", "No|Yes", 0); 


XShift = Param("XShift",35,0,1000,1);
YShift = Param("YShift",0,-1000,1000,1);

m_Color = 10;


  s=ExtractSectionTimeFrame(_SECTION_NAME());
  tf = ConvertToPeriod(s);

  CalcPivotPoints( tf, k, True);

  XOffset= BarCount-1 - xShift;

 if (Show_HiLo)
 {

   Plot (_Hi ,"",m_Color,styleNoLabel|styleDashed);
   PlotText( s+" Hi: "+ NumToStr(_Hi,1.4), XOffset, _Hi+YShift ,m_COLOR);

   Plot (_Lo ,"",m_Color,styleNoLabel|styleDashed);
   PlotText( s+" Lo: "+ NumToStr(_Lo,1.4), XOffset, _Lo+YShift ,m_COLOR);
 }

  
 if (Show_Pivots)
 { 
   if (CP_Show) 
	 {	
		Plot (_CP,"",m_Color,styleNoLabel);
     PlotText( s+" CP: "+ NumToStr(_CP, 1.4), XOffset, _CP+YShift ,m_COLOR);
   }

   if (SR1_Show) 
   {
      Plot(_R1,"",m_Color,styleDashed|styleNoLabel);
		 PlotText( s+" R1: "+NumToStr(_R1, 1.4), XOffset, _R1+YShift,m_COLOR );

      Plot(_S1,"",m_Color,styleDashed|styleNoLabel);
      PlotText( s+" S1: "+NumToStr(_S1, 1.4), XOffset, _S1+YShift,m_COLOR );
      
      
   }
   if (SR2_Show) 
   {
      Plot(_R2,"",m_Color,styleDashed|styleNoLabel);
      PlotText( s+" R2: "+NumToStr(_R2, 1.4), XOffset, _R2+YShift,m_COLOR );	

		 Plot(_S2,"",m_Color,styleDashed|styleNoLabel); 	
      PlotText( s+" S2: "+NumToStr(_S2, 1.4), XOffset, _S2+YShift,m_COLOR );
	 }
   if (SR3_Show) 
	 {
		Plot (_R3,"",m_Color,styleDashed|styleNoLabel);
		PlotText( s+" R3: "+NumToStr(_R3, 1.4), XOffset, _R3+YShift,m_COLOR ); 

		Plot (_S3,"",m_Color,styleDashed|styleNoLabel);
     PlotText( s+" S3: "+NumToStr(_S3, 1.4), XOffset, _S3+YShift, m_COLOR );
    }

   
  }

  if (Show_Camarilla)
  {
    CalcCamarilla( tf, k, True);

    Plot (_H1,"",m_Color,styleNoLabel|styleDashed);
    PlotText( s+" H1: "+ NumToStr(_H1, 1.4), XOffset, _H1+YShift ,m_COLOR);

    Plot (_H2,"",m_Color,styleNoLabel|styleDashed);
    PlotText( s+" H2: "+ NumToStr(_H2, 1.4), XOffset, _H2+YShift ,m_COLOR);

    Plot (_H3,"",m_Color,styleNoLabel|styleDashed);
    PlotText( s+" H3: "+ NumToStr(_H3, 1.4), XOffset, _H3+YShift ,m_COLOR);

    Plot (_H4,"",m_Color,styleNoLabel|styleDashed);
    PlotText( s+" H4: "+ NumToStr(_H4, 1.4), XOffset, _H4+YShift ,m_COLOR);

    Plot (_L1,"",m_Color,styleNoLabel|styleDashed);
    PlotText( s+" L1: "+ NumToStr(_L1, 1.4), XOffset, _L1+YShift ,m_COLOR);

    Plot (_L2,"",m_Color,styleNoLabel|styleDashed);
    PlotText( s+" L2: "+ NumToStr(_L2, 1.4), XOffset, _L2+YShift ,m_COLOR);

    Plot (_L3,"",m_Color,styleNoLabel|styleDashed);
    PlotText( s+" L3: "+ NumToStr(_L3, 1.4), XOffset, _L3+YShift ,m_COLOR);

    Plot (_L4,"",m_Color,styleNoLabel|styleDashed);
    PlotText( s+" L4: "+ NumToStr(_L4,1.4),  XOffset, _L4+YShift ,m_COLOR);

  }
_SECTION_END();

_SECTION_BEGIN("Pivot Lines: Monthly");

Show_Type = ParamList("Show", "None|Pivots|Camarilla", 1);

Show_Pivots = False;
Show_Camarilla = False;

switch (Show_Type)
{
  case "Pivots":	
			Show_Pivots= True;
       Show_Camarilla=False;
			break;

  case "Camarilla":	
			Show_Pivots= False;
       Show_Camarilla=True;
			break;
      
}

Show_HiLo = ParamToggle("Show High/Low", "No|Yes", 0); 
CP_Show   = ParamToggle("Show CP", "No|Yes", 1); 
SR1_Show  = ParamToggle("Show R1/S1", "No|Yes", 1); 
SR2_Show  = ParamToggle("Show R2/S2", "No|Yes", 0); 
SR3_Show  = ParamToggle("Show R3/S3", "No|Yes", 0); 

 
XShift = Param("XShift",50,0,1000,1);
YShift = Param("YShift",0,-1000,1000,1);

m_Color = colorYellow;

  s=ExtractSectionTimeFrame(_SECTION_NAME());
  tf = ConvertToPeriod(s);

  CalcPivotPoints( tf, k, True);

  XOffset= BarCount-1 - xShift;

 if (Show_HiLo)
 {

   Plot (_Hi ,"",m_Color,styleNoLabel|styleDashed);
   PlotText( s+" Hi: "+ NumToStr(_Hi,1.4), XOffset, _Hi+YShift ,m_COLOR);

   Plot (_Lo ,"",m_Color,styleNoLabel|styleDashed);
   PlotText( s+" Lo: "+ NumToStr(_Lo,1.4), XOffset, _Lo+YShift ,m_COLOR);
 }

  
 if (Show_Pivots)
 { 
   if (CP_Show) 
	 {	
		Plot (_CP,"",m_Color,styleNoLabel);
     PlotText( s+" CP: "+ NumToStr(_CP, 1.4), XOffset, _CP+YShift ,m_COLOR);
   }

   if (SR1_Show) 
   {
      Plot(_R1,"",m_Color,styleDashed|styleNoLabel);
		 PlotText( s+" R1: "+NumToStr(_R1, 1.4), XOffset, _R1+YShift,m_COLOR );

      Plot(_S1,"",m_Color,styleDashed|styleNoLabel);
      PlotText( s+" S1: "+NumToStr(_S1, 1.4), XOffset, _S1+YShift,m_COLOR );
      
      
   }
   if (SR2_Show) 
   {
      Plot(_R2,"",m_Color,styleDashed|styleNoLabel);
      PlotText( s+" R2: "+NumToStr(_R2, 1.4), XOffset, _R2+YShift,m_COLOR );	

		 Plot(_S2,"",m_Color,styleDashed|styleNoLabel); 	
      PlotText( s+" S2: "+NumToStr(_S2, 1.4), XOffset, _S2+YShift,m_COLOR );
	 }
   if (SR3_Show) 
	 {
		Plot (_R3,"",m_Color,styleDashed|styleNoLabel);
		PlotText( s+" R3: "+NumToStr(_R3, 1.4), XOffset, _R3+YShift,m_COLOR ); 

		Plot (_S3,"",m_Color,styleDashed|styleNoLabel);
     PlotText( s+" S3: "+NumToStr(_S3, 1.4), XOffset, _S3+YShift, m_COLOR );
    }

   
  }


  if (Show_Camarilla)
  {
    CalcCamarilla( tf, k, True);

    Plot (_H1,"",m_Color,styleNoLabel|styleDashed);
    PlotText( s+" H1: "+ NumToStr(_H1, 1.4), XOffset, _H1+YShift ,m_COLOR);

    Plot (_H2,"",m_Color,styleNoLabel|styleDashed);
    PlotText( s+" H2: "+ NumToStr(_H2, 1.4), XOffset, _H2+YShift ,m_COLOR);

    Plot (_H3,"",m_Color,styleNoLabel|styleDashed);
    PlotText( s+" H3: "+ NumToStr(_H3, 1.4), XOffset, _H3+YShift ,m_COLOR);

    Plot (_H4,"",m_Color,styleNoLabel|styleDashed);
    PlotText( s+" H4: "+ NumToStr(_H4, 1.4), XOffset, _H4+YShift ,m_COLOR);

    Plot (_L1,"",m_Color,styleNoLabel|styleDashed);
    PlotText( s+" L1: "+ NumToStr(_L1, 1.4), XOffset, _L1+YShift ,m_COLOR);

    Plot (_L2,"",m_Color,styleNoLabel|styleDashed);
    PlotText( s+" L2: "+ NumToStr(_L2, 1.4), XOffset, _L2+YShift ,m_COLOR);

    Plot (_L3,"",m_Color,styleNoLabel|styleDashed);
    PlotText( s+" L3: "+ NumToStr(_L3, 1.4), XOffset, _L3+YShift ,m_COLOR);

    Plot (_L4,"",m_Color,styleNoLabel|styleDashed);
    PlotText( s+" L4: "+ NumToStr(_L4,1.4),  XOffset, _L4+YShift ,m_COLOR);

  }
 
_SECTION_END();



_SECTION_BEGIN("Pivot Lines: Quarterly");

Show_Type = ParamList("Show", "None|Pivots|Camarilla", 0);

Show_Pivots = False;
Show_Camarilla = False;

switch (Show_Type)
{
  case "Pivots":	
			Show_Pivots= True;
       Show_Camarilla=False;
			break;

  case "Camarilla":	
			Show_Pivots= False;
       Show_Camarilla=True;
			break;
      
}
Show_HiLo = ParamToggle("Show High/Low", "No|Yes", 0); 

CP_Show   = ParamToggle("Show CP", "No|Yes", 1); 
SR1_Show  = ParamToggle("Show R1/S1", "No|Yes", 0); 
SR2_Show  = ParamToggle("Show R2/S2", "No|Yes", 0); 
SR3_Show  = ParamToggle("Show R3/S3", "No|Yes", 0); 

 
XShift = Param("XShift",70,0,1000,1);
YShift = Param("YShift",0,-1000,1000,1);

m_Color = colorDarkGreen;

  s=ExtractSectionTimeFrame(_SECTION_NAME());
  tf = ConvertToPeriod(s);

  CalcPivotPoints( tf, k, True);

  XOffset= BarCount-1 - xShift;

 if (Show_HiLo)
 {

   Plot (_Hi ,"",m_Color,styleNoLabel|styleDashed);
   PlotText( s+" Hi: "+ NumToStr(_Hi,1.4), XOffset, _Hi+YShift ,m_COLOR);

   Plot (_Lo ,"",m_Color,styleNoLabel|styleDashed);
   PlotText( s+" Lo: "+ NumToStr(_Lo,1.4), XOffset, _Lo+YShift ,m_COLOR);
 }

  
 if (Show_Pivots)
 { 
   if (CP_Show) 
	 {	
		Plot (_CP,"",m_Color,styleNoLabel);
     PlotText( s+" CP: "+ NumToStr(_CP, 1.4), XOffset, _CP+YShift ,m_COLOR);
   }

   if (SR1_Show) 
   {
      Plot(_R1,"",m_Color,styleDashed|styleNoLabel);
		 PlotText( s+" R1: "+NumToStr(_R1, 1.4), XOffset, _R1+YShift,m_COLOR );

      Plot(_S1,"",m_Color,styleDashed|styleNoLabel);
      PlotText( s+" S1: "+NumToStr(_S1, 1.4), XOffset, _S1+YShift,m_COLOR );
      
      
   }
   if (SR2_Show) 
   {
      Plot(_R2,"",m_Color,styleDashed|styleNoLabel);
      PlotText( s+" R2: "+NumToStr(_R2, 1.4), XOffset, _R2+YShift,m_COLOR );	

		 Plot(_S2,"",m_Color,styleDashed|styleNoLabel); 	
      PlotText( s+" S2: "+NumToStr(_S2, 1.4), XOffset, _S2+YShift,m_COLOR );
	 }
   if (SR3_Show) 
	 {
		Plot (_R3,"",m_Color,styleDashed|styleNoLabel);
		PlotText( s+" R3: "+NumToStr(_R3, 1.4), XOffset, _R3+YShift,m_COLOR ); 

		Plot (_S3,"",m_Color,styleDashed|styleNoLabel);
     PlotText( s+" S3: "+NumToStr(_S3, 1.4), XOffset, _S3+YShift, m_COLOR );
    }

   
  }

  if (Show_Camarilla)
  {
    CalcCamarilla( tf, k, True);

    Plot (_H1,"",m_Color,styleNoLabel|styleDashed);
    PlotText( s+" H1: "+ NumToStr(_H1, 1.4), XOffset, _H1+YShift ,m_COLOR);

    Plot (_H2,"",m_Color,styleNoLabel|styleDashed);
    PlotText( s+" H2: "+ NumToStr(_H2, 1.4), XOffset, _H2+YShift ,m_COLOR);

    Plot (_H3,"",m_Color,styleNoLabel|styleDashed);
    PlotText( s+" H3: "+ NumToStr(_H3, 1.4), XOffset, _H3+YShift ,m_COLOR);

    Plot (_H4,"",m_Color,styleNoLabel|styleDashed);
    PlotText( s+" H4: "+ NumToStr(_H4, 1.4), XOffset, _H4+YShift ,m_COLOR);

    Plot (_L1,"",m_Color,styleNoLabel|styleDashed);
    PlotText( s+" L1: "+ NumToStr(_L1, 1.4), XOffset, _L1+YShift ,m_COLOR);

    Plot (_L2,"",m_Color,styleNoLabel|styleDashed);
    PlotText( s+" L2: "+ NumToStr(_L2, 1.4), XOffset, _L2+YShift ,m_COLOR);

    Plot (_L3,"",m_Color,styleNoLabel|styleDashed);
    PlotText( s+" L3: "+ NumToStr(_L3, 1.4), XOffset, _L3+YShift ,m_COLOR);

    Plot (_L4,"",m_Color,styleNoLabel|styleDashed);
    PlotText( s+" L4: "+ NumToStr(_L4,1.4),  XOffset, _L4+YShift ,m_COLOR);

  }
 
_SECTION_END();



_SECTION_BEGIN("Pivot Lines: Yearly");
Show_Type = ParamList("Show", "None|Pivots|Camarilla", 0);

Show_Pivots = False;
Show_Camarilla = False;

switch (Show_Type)
{
  case "Pivots":	
			Show_Pivots= True;
       Show_Camarilla=False;
			break;

  case "Camarilla":	
			Show_Pivots= False;
       Show_Camarilla=True;
			break;
      
}
Show_HiLo = ParamToggle("Show High/Low", "No|Yes", 0); 

CP_Show   = ParamToggle("Show CP", "No|Yes", 1); 
SR1_Show  = ParamToggle("Show R1/S1", "No|Yes", 0); 
SR2_Show  = ParamToggle("Show R2/S2", "No|Yes", 0); 
SR3_Show  = ParamToggle("Show R3/S3", "No|Yes", 0); 

 
XShift = Param("XShift",70,0,1000,1);
YShift = Param("YShift",0,-1000,1000,1);

m_Color = colorDarkYellow;

  s=ExtractSectionTimeFrame(_SECTION_NAME());
  tf = ConvertToPeriod(s);

  CalcPivotPoints( tf, k, True);

  XOffset= BarCount-1 - xShift;

 if (Show_HiLo)
 {

   Plot (_Hi ,"",m_Color,styleNoLabel|styleDashed);
   PlotText( s+" Hi: "+ NumToStr(_Hi,1.4), XOffset, _Hi+YShift ,m_COLOR);

   Plot (_Lo ,"",m_Color,styleNoLabel|styleDashed);
   PlotText( s+" Lo: "+ NumToStr(_Lo,1.4), XOffset, _Lo+YShift ,m_COLOR);
 }

  
 if (Show_Pivots)
 { 
   if (CP_Show) 
	 {	
		Plot (_CP,"",m_Color,styleNoLabel);
     PlotText( s+" CP: "+ NumToStr(_CP, 1.4), XOffset, _CP+YShift ,m_COLOR);
   }

   if (SR1_Show) 
   {
      Plot(_R1,"",m_Color,styleDashed|styleNoLabel);
		 PlotText( s+" R1: "+NumToStr(_R1, 1.4), XOffset, _R1+YShift,m_COLOR );

      Plot(_S1,"",m_Color,styleDashed|styleNoLabel);
      PlotText( s+" S1: "+NumToStr(_S1, 1.4), XOffset, _S1+YShift,m_COLOR );
      
      
   }
   if (SR2_Show) 
   {
      Plot(_R2,"",m_Color,styleDashed|styleNoLabel);
      PlotText( s+" R2: "+NumToStr(_R2, 1.4), XOffset, _R2+YShift,m_COLOR );	

		 Plot(_S2,"",m_Color,styleDashed|styleNoLabel); 	
      PlotText( s+" S2: "+NumToStr(_S2, 1.4), XOffset, _S2+YShift,m_COLOR );
	 }
   if (SR3_Show) 
	 {
		Plot (_R3,"",m_Color,styleDashed|styleNoLabel);
		PlotText( s+" R3: "+NumToStr(_R3, 1.4), XOffset, _R3+YShift,m_COLOR ); 

		Plot (_S3,"",m_Color,styleDashed|styleNoLabel);
     PlotText( s+" S3: "+NumToStr(_S3, 1.4), XOffset, _S3+YShift, m_COLOR );
    }

   
  }

  if (Show_Camarilla)
  {
    CalcCamarilla( tf, k, True);

    Plot (_H1,"",m_Color,styleNoLabel|styleDashed);
    PlotText( s+" H1: "+ NumToStr(_H1, 1.4), XOffset, _H1+YShift ,m_COLOR);

    Plot (_H2,"",m_Color,styleNoLabel|styleDashed);
    PlotText( s+" H2: "+ NumToStr(_H2, 1.4), XOffset, _H2+YShift ,m_COLOR);

    Plot (_H3,"",m_Color,styleNoLabel|styleDashed);
    PlotText( s+" H3: "+ NumToStr(_H3, 1.4), XOffset, _H3+YShift ,m_COLOR);

    Plot (_H4,"",m_Color,styleNoLabel|styleDashed);
    PlotText( s+" H4: "+ NumToStr(_H4, 1.4), XOffset, _H4+YShift ,m_COLOR);

    Plot (_L1,"",m_Color,styleNoLabel|styleDashed);
    PlotText( s+" L1: "+ NumToStr(_L1, 1.4), XOffset, _L1+YShift ,m_COLOR);

    Plot (_L2,"",m_Color,styleNoLabel|styleDashed);
    PlotText( s+" L2: "+ NumToStr(_L2, 1.4), XOffset, _L2+YShift ,m_COLOR);

    Plot (_L3,"",m_Color,styleNoLabel|styleDashed);
    PlotText( s+" L3: "+ NumToStr(_L3, 1.4), XOffset, _L3+YShift ,m_COLOR);

    Plot (_L4,"",m_Color,styleNoLabel|styleDashed);
    PlotText( s+" L4: "+ NumToStr(_L4,1.4),  XOffset, _L4+YShift ,m_COLOR);

  }


_SECTION_END();
 
Last edited:

Similar threads