{Tenkan-sen} TS:= (HHV(H,TSpr) + LLV(L,TSpr))/2; {Kijun-sen} KS:= (HHV(H,KSPr) + LLV(L,KSPr))/2; {Senkou Span A} SSA:= Ref((ts+ks)/2,-(KSPr-1)); {Senkou Span B} SSB := Ref((HHV(H,SSBPr)+LLV(L,SSBPr))/2,-(KSPr-1)); {Chinkou Span} CS := Ref(C,(KSPr-1)); {To paint a cloud} KumoUP:=if(ssa>ssb,if(prev=ref(ssb,-1), ssa, ssb),null); Kumo_Up:=if(ssa>ssb,if(prev=ref(ssa,-1), ssb, ssa),null); KumoDown:=if(ssaSSA and KS>SSB and Cross(TS,KS); NormalBuy:= KSSSB and Cross(TS,KS); WeakBuy:= KSSSB and Cross(KS,TS); WeakSell:= KS>SSA and KS>SSB and Cross(KS,TS);