Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 2

instrument{overlay=true,name="CandleStick

scanner",short_name="CPRC",icon="indicators:AO"}arrow_sze=input(2,"Arrow
Size",input.string_selection,
{"Large","Medium","Normal","Small"})show_engulfing=input(1,"Enable
Engulfing",input.string_selection,{"Yes","No"})include_gap=input(1,"Include gap in
Engulfing/body",input.string_selection,{"Yes Gap","No
Gap"})body_cross_wick=input(1,"Engulfing may cross wick",input.string_selection,
{"Yes","No"})show_hammer=input(1,"Show Bear/Bull Hammer",input.string_selection,
{"Yes","No"})show_marubozu=input(1,"Show Marubozu",input.string_selection,
{"Yes","No"})show_spinningtop=input(1,"Show Spinning Top",input.string_selection,
{"Yes","No"})show_tweezer_tb=input(1,"Show Tweezer
Top/Bottom",input.string_selection,{"Yes","No"})input_group{"Marubozu - UP
COLOR",mbup_color=input{default="#ADFF2F",type=input.color}}input_group{"Marubozu -
DOWN
COLOR",mbdn_color=input{default="#ADFF2F",type=input.color}}input_group{"Engulfing
- UP
COLOR",call_color=input{default="#FF00FF",type=input.color}}input_group{"Engulfing
- DOWN
COLOR",put_color=input{default="#FF00FF",type=input.color}}input_group{"Hammer",hmr
_color=input{default="#00FFFF",type=input.color}}input_group{"Inverted
Hammer",ihmr_color=input{default="#00FFFF",type=input.color}}input_group{"Hanging
Man",hgm_color=input{default="#00FFFF",type=input.color}}input_group{"Shotting
Star",shtr_color=input{default="#00FFFF",type=input.color}}input_group{"Spinning
top - UP
COLOR",spiningup_color=input{default="#FFA07A",type=input.color}}input_group{"Spinn
ing top - DOWN
COLOR",spiningdn_color=input{default="#FFA07A",type=input.color}}input_group{"Twize
er - UP
COLOR",twezerup_color=input{default="#FFFF00",type=input.color}}input_group{"Twizee
r - DOWN COLOR",twezerdn_color=input{default="#FFFF00",type=input.color}}if
arrow_sze==1 then arrow_size_id=shape_size.huge elseif arrow_sze==2 then
arrow_size_id=shape_size.large elseif arrow_sze==3 then
arrow_size_id=shape_size.normal elseif arrow_sze==4 then
arrow_size_id=shape_size.small end;if body_cross_wick==1 then
eng_bodyup=close>high[1]eng_bodudn=close<low[1]else if body_cross_wick==2 then
eng_bodyup=close>open[1]eng_bodudn=close<open[1]end end;Shadow=high-
low;Body=abs(close-open)is_body_up=open<close and
Body>=Shadow*0.3;id_body_dn=open>close and
Body>=Shadow*0.3;engulfingup=close[1]<open[1]and close>open and eng_bodyup and
close[1]>=open;enfulfingdn=close[1]>open[1]and close<open and eng_bodudn and
close[1]<=open;engulfingup_gap=close[1]<open[1]and close>open and
eng_bodyup;enfulfingdn_gap=close[1]>open[1]and close<open and
eng_bodudn;is_hammer=open<close and close>high-Shadow*0.05 and Body<=Shadow*0.4 and
Body>Shadow*0.2;is_inverted_hammer=open<close and open<low+Shadow*0.05 and
Body<=Shadow*0.4 and Body>Shadow*0.2;is_hangingMan=open>close and open>high-
Shadow*0.05 and Body<=Shadow*0.4 and Body>Shadow*0.2;is_shottingStar=open>close and
close<low+Shadow*0.05 and Body<=Shadow*0.4 and
Body>Shadow*0.2;is_marubozuup=open<close and close>high-Shadow*0.02 and
open<low+Shadow*0.02 and Body>Shadow*0.95;is_marubozudn=open>close and
close<high+Shadow*0.02 and open>low-Shadow*0.02 and
Body>Shadow*0.95;is_spinningtop=open<close and close<high-Shadow*0.30 and
open>low+Shadow*0.30 and Body<Shadow*0.4 and
Body>Shadow*0.05;is_spinningbtn=open>close and open<high-Shadow*0.30 and
close>low+Shadow*0.30 and Body<Shadow*0.4 and
Body>Shadow*0.05;is_tweezertop=close[1]<open[1]and close>open and
low==low[1]is_tweezerbtm=close[1]>open[1]and close<open and high==high[1]if
include_gap==1 and show_engulfing==1 then
plot_shape(engulfingup_gap,"Bull_Engulfing",shape_style.arrowup,arrow_size_id,call_
color,shape_location.belowbar,0,"Eng",call_color)plot_shape(enfulfingdn_gap,"Bear_E
ngulfing",shape_style.arrowdown,arrow_size_id,put_color,shape_location.abovebar,0,"
Eng",put_color)else if include_gap==2 and show_engulfing==1 then
plot_shape(engulfingup,"Bull_Engulfing",shape_style.arrowup,arrow_size_id,call_colo
r,shape_location.belowbar,0,"Eng",call_color)plot_shape(enfulfingdn,"Bear_Engulfing
",shape_style.arrowdown,arrow_size_id,put_color,shape_location.abovebar,0,"Eng",put
_color)end end;if show_hammer==1 then
plot_shape(is_hammer,"Hammer",shape_style.triangleup,arrow_size_id,hmr_color,shape_
location.belowbar,0,"Hmr",hmr_color)plot_shape(is_inverted_hammer,"Inverted
Hammer",shape_style.triangleup,arrow_size_id,ihmr_color,shape_location.belowbar,0,"
Ihmr",ihmr_color)plot_shape(is_hangingMan,"Hanging
Man",shape_style.triangledown,arrow_size_id,hgm_color,shape_location.abovebar,0,"Hg
m",hgm_color)plot_shape(is_shottingStar,"Shotting
Star",shape_style.triangledown,arrow_size_id,shtr_color,shape_location.abovebar,0,"
Str",shtr_color)end;if show_marubozu==1 then plot_shape(is_marubozuup,"Marobotu
UP",shape_style.diamond,arrow_size_id,mbup_color,shape_location.belowbar,0,"Mzu",mb
up_color)plot_shape(is_marubozudn,"Marubozu
Down",shape_style.diamond,arrow_size_id,mbdn_color,shape_location.abovebar,0,"Mzu",
mbdn_color)end;if show_spinningtop==1 then
plot_shape(is_spinningtop,"BullSpinningtop",shape_style.circle,arrow_size_id,spinin
gup_color,shape_location.belowbar,0,"SPT",spiningup_color)plot_shape(is_spinningbtn
,"BearSpinningtop",shape_style.circle,arrow_size_id,spiningdn_color,shape_location.
abovebar,0,"SPT",spiningdn_color)end;if show_tweezer_tb==1 then
plot_shape(is_tweezertop,"TweezerTop",shape_style.cross,arrow_size_id,hgm_color,sha
pe_location.belowbar,0,"TWE",hgm_color)plot_shape(is_tweezerbtm,"TweezerBottom",sha
pe_style.cross,arrow_size_id,twezerup_color,shape_location.abovebar,0,"TWE",twezerd
n_color)end

You might also like