Using ESPL in Ensign Windows

Prior | Next

Ensign Windows allows you to program your own studies, draw tools, custom symbols, and Trading Systems.  ESPL programs are saved in ASCII text files and can be loaded into the ESPL Editor screen.  An ESPL program file must be loaded and compiled before the custom programs can be run.  You can manually open the ESPL Editor screen by clicking on the ESPL button on the main toolbar.     

The ESPL Editor window will open.  The last program that you loaded will be displayed.  You can load a new ESPL file by clicking on the 'Open' file button, or by clicking the TABS at the bottom of the Editor screen.  Click the  'New'  button to start a new ESPL program.

The sample ESPL programming code below contains code for a simple Chart study that connects the Highs, Lows, and Closing prices.  You can COPY and PASTE this code into the ESPL Editor window if you want to try it out yourself. 

{********************************************}
procedure DrawLines;
var
 i: integer;
begin
 if BarBegin <> BarEnd then
 begin
  SetUser(eName,'MyLines');
  SetUser(ePlot1,True); SetUser(eShow1,True);
  SetUser(ePlot2,True); SetUser(eShow2,True);
  SetUser(eClose,True);
 end;

 for i:=BarBegin to BarEnd do
 begin
  Plot(1,High(i),i,clRed,1,0,0);
  Plot(2,Last(i),i,0,0,28,clAqua);
  Plot(3,Low(i),i,clLime,1,0,0);
 end;
end;

{**********Main Program**********}
begin
 if ESPL=1 then writeln('Hello world');
 if ESPL=2 then Output(eClear);
 if ESPL=3 then Beep;
 if ESPL=51 then DrawLines;
end;
{********************************************}

To run the 'DrawLines' chart study, open a chart, and then click the ESPL RUN button.  Click button 51 to apply the study on the chart.

Ensign Windows can automatically load and compile an ESPL program file, whenever Ensign Windows runs.  Select  'Set-Up | ESPL'  from the main menu to open the ESPL Setup screen.  You can specify which ESPL file to load.  The example below will load a file named 'MyPrograms.spt' from the  \ENSIGN\ESPL  folder.

Using this set-up screen allows you to load and compile your ESPL file each time that Ensign Windows runs.  The ESPL programs will then be available to run at anytime (without requiring you to manually open the ESPL Editor screen, load the file, and then run it).

Prior | Next