|
Pattern Scripts
Pattern scripts are used to automatically recognize and highlight data bar patterns
that provide insight to the future price movements of stock, futures and FOREX symbols.
Pattern scripts can be used in three different ways:
- Trading strategy scripts,
heat study scripts and even other pattern scripts, among others, can use a pattern
script directly from their own code.
- Pattern scripts can be visually plotted on financial charts.
- Watchlists can be setup to show pattern script values.
The IQBroker automated trading software ships with a library of premade pattern scripts that can be parameterized
and customized without any programming, while custom scripts can be easily developed
using the resource designer and IQLanguage.
Script Implementation
|
OnInitialize()
|
|
This function is called automatically when the script is first initialized.
|
|
|
OnPattern(barIndex As Integer) As Integer
|
|
barIndex – The bar index specifies the relative bar going backwards from
the latest bar, such that 0 is the latest bar, 1 is the bar before the latest one,
…, N is the Nth bar before the latest bar.
|
|
This function is used to return the total number of bars in the pattern ending at
the specified bar. If there is no pattern ending at the specified bar then zero
is returned.
|
|
|