User login

  

PTL Basic Concepts

There are a few available scripts for PTL:

  1. Autobroker
  2. Indicator
  3. Trading System
  4. Package

A project of each script  provides a skeleton  by listing the essential entry functions of the indicator or strategy. An entry function is a function called directly from the trading terminal on a specific event. In the code, such functions are marked with the keyword entry.

  • Each script must have special entry function.

For fast viewing of function's (constant's, variables's) description  use Dictionary or Intellisence.

Entry points

The function OnQuote is the entry point to the Trading System and Indicator script. The Trading System also has some other entry points: you can add one, or both. A trading system and indicator include the following entry functions:

function void OnQuote() entry

{

    //  -- Enter your code here --

};

The OnQuote() function is called each time a new quote is received.

function void NextBar() entry

{

    //  -- Enter your code here --

};

The NextBar() function is called each time a new bar from Chart is received (depends on tick value).  

  • Note: When Chart period value set as tick, there are no difference between NextBar() and OnQuote() function

function bool Init() entry

{

    //  -- Enter your code here --

};

The Init() function is called when the user invokes the strategy.

function void Complete() entry

{

    //  -- Enter your code here --

};

The Complete() function is called when the user deletes the strategy.

  • Autobroker has special entry function that differ from Indicator and Trading System.

 So if you need to run some code before the main Trading System (Indicator) sequence, then put this code into the Init() function, and if you need some code to run after the Trading System (Indicator) sequence, then put this code into the Complete() function.

12345