The attached sketch shows lines I've drawn using the following simple code:
if (!newblueline && GoodDirection[0] == 1 && GoodDirection[1] != 1) { newblueline = true; newredline = false; barcountstart = CurrentBar; startline = Close[0]; } if (newblueline && GoodDirection[0] != 1 && GoodDirection[1] == 1) { barcountend = CurrentBar; endline = Close[0]; //newblueline = false; } if (!newredline && GoodDirection[0] == -1 && GoodDirection[1] != -1) { newredline = true; newblueline = false; barcountstart = CurrentBar; startline = Close[0]; } if (newredline && GoodDirection[0] != -1 && GoodDirection[1] == -1) { barcountend = CurrentBar; endline = Close[0]; //newredline = false; } if (newblueline) DrawLine("newlineblue"+CurrentBar,true,(CurrentBar - barcountstart),startline,(CurrentBar - barcountend), endline, Color.Blue,DashStyle.DashDot,3); if (newredline) DrawLine("newlinered"+CurrentBar,true,(CurrentBar - barcountstart),startline,(CurrentBar - barcountend), endline, Color.Red,DashStyle.DashDot,3);
http://screencast.com/t/Dxt256mz
Please advise what needs to change with the code to plot one red line in the orchid/purple zone, one blue line in the blue zone, and no plots in the blank zone.
Thanks.
Kirk
Comment