[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

easy language help - trendlines



PureBytes Links

Trading Reference Links


Could someone kindly help modify the following code to accomplish the
following:

1-  show an uptrend plotted on lows and a downtrend plotted on the highs, so
breakouts are meaningful
2- extend the trendline on the right to the end of screen on the right.

I created following from material in Arthur Putt's book "Using Easy
Language".  Although it plots two lines,
it still fails to do the two items above.

If it's easier to offer entirely different code that accomplishes same,
would appreciate that also.

Thanks,

Barry

===================================================
Inputs:  SHStgth(4), SLStgth(4), DnTndClr("Blue"), UptndClr("Red");

Vars: DnTndClrVar(0), UpTndClrVar(0);
Arrays:  SHArray[12,3](0),  SLArray[12,3](0);

If CurrentBar = 1 then begin
 DnTndClrVar = StrColorToNum(DnTndClr);
 UptndClrVar = StrColorToNum(UpTndClr);
 end;


 If PivotHighVSBar(1, High, 4, 2, SHStgth + 1) = SHStgth then begin
  For Value1 = 11 Downto 0 begin
   For Value2 = 0 to 3 begin
    SHArray[Value1+1, Value2] = SHArray[Value1, Value2];
   end;
  end;
  SHArray[0,0] = Date[SHStgth];
  SHArray[0,1] = Time[SHStgth];
        SHArray[0,2] = High[SHStgth];
  SHArray[0,3] = BarNumber[SHStgth];
 end;

 If PivotLowVSBar(1, low, 4,  2, SLStgth + 1) = SLSTgth then begin
  For Value1 = 11 Downto 0 begin
   For Value2 = 0 to 3 begin
    SLArray[Value1 + 1, Value2] = SLArray[Value1, Value2];
   end;
  end;
        SLArray[0,0] = Date[SLStgth];
        SLArray[0,1] = Time[SLStgth];
        SLArray[0,2] = Low[SLStgth];
        SLArray[0,3] = BarNumber[SLStgth];
  end;

If Date = LastCalcDate Then begin

  Value10 = TL_New(SHArray[1,0], SHArray[1,1], SHArray[1,2],
      SHArray[0, 0], SHArray[0, 1], SHArray[0, 2]);

  Value11 = TL_New(SLArray[1,0], SLArray[1,1], SLArray[1,2],
    SLArray[0, 0], SLArray[0, 1], SLArray[0, 2]);

        Value20 = TL_SetColor(Value10, DnTndClrVar);
        Value21 = TL_SetColor(Value11, UptndClrVar);

  Value30 = TL_Setextright(value10, true);
        Value31 = TL_Setextright(value11, true);
End;