There are a few available scripts for PTL:
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.
For fast viewing of function's (constant's, variables's) description use Dictionary or Intellisence.
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).
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.
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.