|
Drawing Scripts
Drawing scripts are used to draw points, lines and labels which form a 2D drawing that
can be used to analyze the future price movements of stock, futures and FOREX symbols.
Drawing scripts can be used in three different ways:
- Trading strategy scripts, heat study scripts and even other drawings scripts, among
others, can use a drawing script directly from their own code.
- Drawing scripts can be visually plotted on financial charts.
The IQBroker automated trading software ships with a library of premade drawing 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
Each drawing is drawn using a predefined number of core point, that are either set
manually by clicking on a financial chart or programmatically by a script. When
a drawing is manually being drawn on a chart the OnDraw function is repeatedly called
as the mouse moves over the chart, so that the drawing is constantly redrawn according
to the mouse position. When a drawing is drawn programmatically the script using the
drawing calls the OnDraw function indirectly by calling the drawing library function
- DrawingDraw.
|
OnInitialize()
|
|
This function is called automatically when the script is first initialized.
|
|
|
OnDraw()
|
|
This function is used to set all of the drawing points, line and labels on a virtual
canvas, whose x-axis values are the date and time of the symbol bars being analyzed
and whose y-axis values are the symbol prices.
|
|
|