Sir, I just replaced DH and DL with RH and RL and its working fine showing the last days resistance/support at the defined time and no crooked line. The code line that was changed is as below:
Hope it helps. Thnx
Code:
RH = IRHigh; RHI = LastValue (RH,1);// 15 Min high
RL = IRLow; RLI = LastValue (RL,1); // 15 Min low
_SECTION_BEGIN("Initial Range HI-LO");
beginTradeTime = ParamTime("Strt Time ", "9:15:00");
endRangeTime = ParamTime("Range Time","9:30:00");
RH = deTimeRangeHHV(H,beginTradeTime ,endRangeTime );
RL = deTimeRangeLLV(L,beginTradeTime ,endRangeTime);
IRHL = ParamToggle("InitialRange HI LO","Show|Hide",1);
if(IRHL==1) {
Plot(RL,"RL",colorRed,styleLine|styleThick|styleNoRescale|styleNoTitle|styleNoLabel,0,0,0,0);
Plot(RH,"RH",colorRed,styleLine|styleThick|styleNoRescale|styleNoTitle|styleNoLabel,0,0,0,0);
}
beginTradeTime = ParamTime("Strt Time ", "9:15:00");
endRangeTime = ParamTime("Range Time","9:30:00");
RH = deTimeRangeHHV(H,beginTradeTime ,endRangeTime );
RL = deTimeRangeLLV(L,beginTradeTime ,endRangeTime);
IRHL = ParamToggle("InitialRange HI LO","Show|Hide",1);
if(IRHL==1) {
Plot(RL,"RL",colorRed,styleLine|styleThick|styleNoRescale|styleNoTitle|styleNoLabel,0,0,0,0);
Plot(RH,"RH",colorRed,styleLine|styleThick|styleNoRescale|styleNoTitle|styleNoLabel,0,0,0,0);
}