PureBytes Links
Trading Reference Links
|
Hi there,
Here is what I want to accomplish:
I want breakdown the charting price range according to the user define scale
setting range by horizontal lines.
Eg: price rang for the chart is set to 2000 - 4900, I would want TS to
calculate 4900 / 70 = 70, and than subtract from 4900 - 70, = 4830 and draw
a horizontal line from the first date of the chart to the last calculated
date at 4830.
Next horizontal line would be at 4830 - 70 = 4760 and so forth until the
2000 mark is reached.
I hope that is clearer than the code.
Thanks in advance Normanf
----------------------------------------------------------------------------
-----------------------------
Inputs:length(70),Min(3080.00),Max(4 900.000);
vars:ntl(0),sDate(date),stime(time),counter(0),sVa l(0);
Arrays: RHDate[10](99999), RHTime[10](99999), RHVal[10](0),RHTLRef[10](0);
if currentbar = 1 then begin
RHDate[0] = Date[0];
RHTime[0] = Time[0];
End;
If currentbar > 1 then begin
for counter = 1 to 28 begin
if counter = 1 then begin
sVal = Max;
ntl = 1;
end
else
sVal = sval - length;
ntl = ntl +1;
end;
end;
For counter = 1 to ntl begin
sVal = sval - length;
RHVal[counter] = sVal;
RHTLRef[counter] = TL_New(RHDate[0], RHTime[0], RHVal[counter], LastCalcDate
, RHTime[0], RHVal[counter]);
RHTLRef[counter] = TL_SetExtRight(RHTLRef[counter], true);
RHTLRef[counter] = TL_SetStyle(RHTLRef[counter], -3); {dashed}
end;
|