How to use Ensign Charting Software and Trading Tips

Main menu

Category Archives: ESPL

Post navigation

Q: How can ESPL be notified when the Ensign program is closing so that information can be saved before the program closes?

A: Redirect the OnCloseQuery event for the main Ensign form to an ESPL procedure which performs the clean-up tasks such as saving information. The main Ensign form is referenced with the component named frmMain. This example will print a message in the Output window when Ensign closes.

Cick ESPL button 3 to establish the redirection of the OnCloseQuery event. Then when Ensign exits, the OnCloseQuery event fires and executes the ESPL ShutDown procedure which displays ‘Exiting’ in the Output window. Ensign continues its exit process and closes down.

Q: I’d like to create and edit daily a custom symbol with about 50 or more stocks in the index. Instead of editing ESPL code, would it be possible to reference an array in the E10 spreadsheet, which can be updated more easily? What would the basic code look like?

A: Use the predefined sList variable which is a TStringList variable. TStringList has useful methods for working with a list of strings. The data source file would be an ASCII file that you edit using Notepad, or it could be a custom quote page file, such as MyList.dat. When using a custom quote file the records have a market group character in the 1st character position, followed by the symbol. This example copies the symbol from the 2nd character position.

Q: I have used Ensign for years…and I am very happy with it. I look at about 14 markets. I set up each market with 2-3 charts in a workspace. I click onto a workspace and this works well for me. I was trying to use the Layer function in Ensign 10 for the same effect, but the numbered tabs do not label that particular market, there are only 9 tabs, and my understanding is that it requires more CPU. Is there any chance of having layout tabs in Ensign 10 that serves the same function as the workspace tabs in Ensign Windows?

A: There are no plans to add a tab control which shows layout names to replicate the EW feature. However, the E10 ESPL language is very powerful and could be used to create the tabs feature. This is the essence of the ESPL implementation of a tab control.

Starting with a New Project, put a tab control on the form, and resized the form and the tab control. At design time, edited the TABS property to add names for the tabs, such as is shown on the form, using words of ‘First’, ‘Second’, ‘Third’ etc.

In the Change event for the tab control, write code that opens different layouts using the Layout function. Here is the code example.

Q: Are you planning to add btnReset to ESPL in E10, or is there another way of automatically rescaling all the open charts in E10?

A: You would write a loop to give each open chart focus, and then use these 3 statements to accomplish a scale reset. Task #198 resets the chart scale to its default. Since the chart pop-up menus are not registered in ESPL, the trick is to set the tag for the mnuSaveLayout which is exposed in ESPL. After doing the click event, reset the tag for this menu back to its original 900 value. See the documentation in the DYO manual for the IF # then Action #2 statement for a full listing of action values that could be performed by this method.