Creating and saving of a package with a strategy using an indicator in Indicore SDK 3.0

From FxCodeBaseWiki
Jump to: navigation, search

Creating and saving of a package with a strategy using an indicator in Indicore SDK 3.0.(A step by step instruction)

Introduction

The article provides a step by step instruction for creating and saving a package with a strategy and an indicator used by it in Indicore SDK 3.0. As an example, OsMA Strategy and its OsMA indicator are used, but you can create packages with other strategies and indicators in the same way.

1. Preparing the system

Download and install the latest version of Indicore SDK 3.0. During the installation, use the default settings.

2. Creating of a project with an indicator

  1. Run the file "debugger.exe" from the folder "C:\Gehtsoft\IndicoreSDK3\debugger.exe".
  2. The main window appears on the screen.
    The main window appears on the screen
  3. In the main window on the toolbar, click New Indicator.
  4. The Save As window appears. Type the name, under which you want to save the indicator. In our case, it is OsMA. As a location, select the default folder – indicators.
    The Save As window
  5. The New Indicator dialog box appears allowing you to select how the file is to be created: as an empty file or a file created with a wizard.
  6. Click Create empty file.
    Create empty file
  7. After clicking OK, the window closes and the file OsMA.lua appears on the disk in a specified location.
  8. Please note that the appearance of the main window has changed. A project tree containing the New project entry has appeared. In the project tree, there has appeared the ОsMA.lua file, and in the editor window, – the ОsMA tab. The project tree lists all files of the project. In our case, the project has only one file. The editor window displays the tabs containing indicators and strategies. In our case, the window has only one tab.
    the appearance of the main window has changed

3. Creating and debugging of the indicator

  1. The indicator code should be written in the OsMA tab of the editor window. For example, copy the text of the proposed indicator.
    The indicator code should be written in the OsMA tab of the editor window
  2. As you can see, everything is quite simple. Let's test the newly created indicator. Press the F5 key or click the corresponding button on the toolbar.
  3. The Parameters window appears on your screen, in which you should set the parameters of the indicator.
    set the parameters of the indicator
  4. To build the indicator click the price source. In our case, it is First Instrument Price Source. The Choose Price Source window appears.
    click the price source
  5. Select the symbol of your choice, for example, EUR/USD and specify the time range in the From: and To: boxes, and then click OK to return to the Parameters window.
  6. Set the value of the Pre-deliver Prices parameter to True.
  7. Click OK.
  8. The program downloads the prices within the specified time range.
  9. Press the F5 key again.
  10. On the toolbar, click Chart and make sure that the indicator is working properly.
    tab 'Chart'
  11. Now you need to save your work as a project. On the toolbar, click Save All.
  12. The Save window offering to save the project appears. Click Yes.
    save the project
  13. The Save as window appears. Type the name for the project – OsMA_indicator, and then click Save.
    Type the name for the project – OsMA_indicator,  and then click Save
  14. 3.15 The main window appears. Note that the project tree contains the name of the project – OsMA_indicator.
    the project tree contains the name of the project
  15. The development of the indicator for the strategy is completed. Now, if you need to make any changes to the indicator, you can easily open the OsMA_indicator.prj project and make these changes.

4. Creating of a project with a strategy

  1. If Indicore SDK is not running, start it.
  2. In the main window, on the toolbar, click New Strategy.
  3. The Save As window appears. Type the name, under which you want to save the file. In our case, it is OsMA_Strategy. As a location, select the default folder – strategies.
    Type the name, under which you want to save the file
  4. The New Strategy dialog box appears allowing you to select how the file is to be created: as an empty file or a file created with a wizard.
    New Strategy
  5. Click Create empty file.
  6. After clicking OK, the window closes and the OsMA_Strategy.lua file appears on the disk in a specified location.
  7. The main window appears containing a New project entry. In the project tree, there has appeared the OsMA_Strategy.lua file, and in the editor window, – the OsMA_ Strategy tab.
    The main window appears containing a New project entry
  8. To be operational your strategy needs an indicator. Add an indicator to the project by clicking Add file to Project.
  9. The Open window appears listing the name of the file containing the indicator that you have already developed.
    The Open window appears listing the name of the file containing the indicator that you have already developed
  10. Click the file name.
  11. Note that the main window has changed. Now it looks like this:
    the main window has changed
  12. Now the project tree lists both the strategy and indicator files. In the editor window, a tab for writing a strategy is opened. The tab with the indicator's text is not opened, but you can open it if you wish by double-clicking the name of the indicator.

5. Creating and debugging strategies

  1. The strategy code should be written in the OsMA_Strategy tab of the editor window. For example, you can copy the text of a strategy proposed on our forum.
    The strategy code should be written in the OsMA_Strategy tab of the editor window
  2. That's it, the strategy is ready for the first run.
  3. Press the F5 key or click the corresponding button on the toolbar.
  4. The Parameters window appears, in which you should set the parameters of the strategy.
    you should set the parameters of the strategy
  5. Click the price source the strategy is to work with. In our case, it is First Instrument Price Source.
  6. The Choose Price Source window appears.
    First Instrument Price Source
  7. Select the symbol of your choice, for example, EUR/USD and specify the time range in the From: and To: boxes.
  8. Click OK to return to the Parameters window. Everything is ready to start debugging.
    everything is ready
  9. Click OK.
  10. On the toolbar, click Chart and make sure that the strategy is working properly.
  11. Open the Account tab and make sure that the data changes.
  12. On the toolbar, click Stop.
  13. Now you need to save your work as a project. On the toolbar, click Save All.
  14. The Save window appears asking whether you want to save the project. Click Yes.
    save the project
  15. The Save as window appears. Type the name for the project – QsMA_Strategy, and then click Save.
    Type the name for the project –  QsMA_Strategy, and then click Save
  16. 5.18 The main window appears. Note that the project tree contains the name of the project – OsMA_Strategy.
    the project tree contains the name of the project
  17. That's it, the development of the strategy is completed.

6. Saving the strategy and file as a package

  1. Before saving the indicator and strategy as a package, we need to set the parameters of the indicator's visibility. Right-click in any free space in the project tree.
  2. In the menu that appears, click Properties.
  3. The Properties window appears as shown in the following picture.
    The Properties window appears
  4. Since we do not want to make the OsMA indicator visible to others, it is necessary to make sure that the indicator's parameter allowing to make it public is not selected. To do this, click the Public Package Files tab and make sure that the indicator's check box is clear.
    Public Package Files
  5. When you save an indicator and a strategy as a package, you can also save them in the form of compiled files with the Bin extension. As it is not required in our example, make sure the appropriate settings are not selected. To do this, click the Compiled Package Files tab and make sure that the indicator's check box is clear.
    make sure that the indicator's check box is clear
  6. Confirm your selection by clicking OK.
  7. On the toolbar, click Create Package.
  8. The Save as window appears. Type the name of the QsMA package being saved.
    Type the name of the QsMA package being saved
  9. Click Save. That's it, our strategy and indicator are saved as the QsMA.ipk file in a specified location.