/*[[ Name := Camarilla Pivot Author := Adapted from D-Pivot-N by Doc Faglie Link := Notes := Separate Window := No First Color := Magenta First Draw Type := Line First Symbol := 217 Use Second Data := Yes Second Color := Red Second Draw Type := Line Second Symbol := 218 ]]*/ var: cnt(0),how_long(720), begin_bar(0), prev_day(0), cur_day(0), day_high(0),day_low(0), yesterday_high(0), yesterday_low(0), yesterday_close(0), today_open(0), textvar(""), P(0),S(0),R(0),S1(0),R1(0),S2(0),R2(0),S3(0),R3(0),S4(0),R4(0), timeShift(0),lastMinute(0), prevTime(0); for cnt = Bars downto 0 { SetIndexValue(cnt, 0); SetIndexValue2(cnt, 0); }; if Period > 240 then exit; timeShift = 0; if how_long = -1 then { begin_bar = bars; } else { begin_bar = how_long; }; If prevTime = Time then exit; for cnt = begin_bar downto 1 { cur_day = TimeDay(time[cnt]); if prev_day != cur_day then { yesterday_close = CLOSE[cnt+1]; today_open = OPEN[cnt]; yesterday_high = day_high; yesterday_low = day_low; MoveObject("dayChange",OBJ_VLINE,time[cnt],close[cnt],time[cnt],close[cnt],RED,1,STYLE_SOLID); If TimeDayOfWeek(time[cnt])=2 Then { MoveObject("weekChange",OBJ_VLINE,time[cnt],close[cnt],time[cnt],close[cnt],BLUE,1,STYLE_SOLID); } P = (yesterday_high + yesterday_low + yesterday_close) / 3; R1 = ((((yesterday_high-yesterday_low)*1.1)/12)+yesterday_close); S1 = (yesterday_close-((yesterday_high-yesterday_low)*1.1)/12); R2 = ((((yesterday_high-yesterday_low)*1.1)/6)+yesterday_close); S2 = (yesterday_close-((yesterday_high-yesterday_low)*1.1)/6); R3 = ((((yesterday_high-yesterday_low)*1.1)/4)+yesterday_close); S3 = (yesterday_close-((yesterday_high-yesterday_low)*1.1)/4); R4 = ((((yesterday_high-yesterday_low)*1.1)/2)+yesterday_close); S4 = (yesterday_close-((yesterday_high-yesterday_low)*1.1)/2); day_high = HIGH[cnt]; day_low = LOW[cnt]; prev_day = cur_day; }; day_high = max(day_high, HIGH[cnt]); day_low = min(day_low, LOW[cnt]); textVar = TimeHour(time[0])+":"+TimeMinute(time[0])+" "+(60-Minute)+"R"; SetObjectText("Time",textVar,"Arial",8,White); MoveObject("Time",OBJ_TEXT,time[25],P,time[25],P,White); }; SetObjectText("P_txt","Pivot "+P,"Arial",8,White); MoveObject("P_txt",OBJ_TEXT,time[25],P,time[25],P,White); SetObjectText("H1_txt","H1 "+R1,"Arial",8,White); MoveObject("H1_txt",OBJ_TEXT,time[25],R1,time[25],R1,White); SetObjectText("H2_txt","H2 "+R2,"Arial",8,White); MoveObject("H2_txt",OBJ_TEXT,time[25],R2,time[25],R2,White); SetObjectText("H3_txt","H3 "+R3,"Arial",8,White); MoveObject("H3_txt",OBJ_TEXT,time[25],R3,time[25],R3,White); SetObjectText("H4_txt","H4 "+R4,"Arial",8,White); MoveObject("H4_txt",OBJ_TEXT,time[25],R4,time[25],R4,White); SetObjectText("L1_txt","L1 "+S1,"Arial",8,White); MoveObject("L1_txt",OBJ_TEXT,time[25],S1,time[25],S1,White); SetObjectText("L2_txt","L2 "+S2,"Arial",8,White); MoveObject("L2_txt",OBJ_TEXT,time[25],S2,time[25],S2,White); SetObjectText("L3_txt","L3 "+S3,"Arial",8,White); MoveObject("L3_txt",OBJ_TEXT,time[25],S3,time[25],S3,White); SetObjectText("L4_txt","L4 "+S4,"Arial",8,White); MoveObject("L4_txt",OBJ_TEXT,time[25],S4,time[25],S4,White); MoveObject("H1_line",OBJ_HLINE,time[cnt],R1,time[cnt],R1,LightBlue,1,STYLE_SOLID); MoveObject("H2_line",OBJ_HLINE,time[cnt],R2,time[cnt],R2,LightBlue,1,STYLE_SOLID); MoveObject("H3_line",OBJ_HLINE,time[cnt],R3,time[cnt],R3,LightBlue,1,STYLE_SOLID); MoveObject("H4_line",OBJ_HLINE,time[cnt],R4,time[cnt],R4,LightBlue,1,STYLE_SOLID); MoveObject("P_line",OBJ_HLINE,time[cnt],P,time[cnt],P,Gold,1,STYLE_DASH); MoveObject("S1_line",OBJ_HLINE,time[cnt],S1,time[cnt],S1,LightCoral,1,STYLE_SOLID); MoveObject("S2_line",OBJ_HLINE,time[cnt],S2,time[cnt],S2,LightCoral,1,STYLE_SOLID); MoveObject("S3_line",OBJ_HLINE,time[cnt],S3,time[cnt],S3,LightCoral,1,STYLE_SOLID); MoveObject("S4_line",OBJ_HLINE,time[cnt],S4,time[cnt],S4,LightCoral,1,STYLE_SOLID); prevTime = Time; Exit;