ESPL: Study Rising Falling Flag

The following ESPL example will plot GREEN circles when the Study Average is rising, and RED circles when the Study Average is falling.   This chart has an Ergodic study and the ESPL study applied.

GetStudy

The GetStudy statement references for 1st line, 2nd line, 3rd line, and 4th line refer to the various Lines that can be plotted by a Study.

  • The 1st line is the main study line.
  • The 2nd line is most often the Average of the main study line.
  • Sometimes there isn’t a 3rd line for a study….sometimes there is.
  • The 4th line is most often the Spread line values.

The example below is testing the GetStudy 15 value…. (Is the 2nd line Rising?)

uses
   Classes, Graphics, Controls, Forms, Dialogs;
procedure CheckErg;
var
   i, iHandle:integer;
begin 
   iHandle := FindStudy(eERG); 
   for i := BarBegin to BarEnd do 
   begin 
      if GetStudy(iHandle,15,i) then 
         Plot(1,Last(i),i,0,0,21,clLime) 
      else
         Plot(1,Last(i),i,0,0,21,clRed); 
   end;
end;
begin
   if ESPL=100 then CheckErg;
end;

Click ESPL button 100 to apply and run the ESPL study on the chart.