Difference between revisions of "Indicators API functions"
Line 61: | Line 61: | ||
<br> | <br> | ||
<br>'''The Symbol and the Timeframe are the ones related to the attached chart.''' | <br>'''The Symbol and the Timeframe are the ones related to the attached chart.''' | ||
<br> | |||
Here are the generic data access functions, specifying the Symbol or Timeframe : | |||
<br> | |||
{| class=wikitable cellpadding="10" style="border-style: solid; border-width: 2px" | |||
|- | |||
! Function name !! Description || Parameters || Returned value | |||
|- | |||
| '''iOpen(string Symbol, int Timeframe, int Index)''' || Get the Open value of the bar || The Symbol, the Timeframe, the Index || double | |||
|- | |||
| '''iHigh(string Symbol, int Timeframe, int Index)''' || Get the High value of the bar || index of the bar || The Symbol, the Timeframe, the Index || double | |||
|- | |||
| '''iLow(string Symbol, int Timeframe, int Index)''' || Get the Low value of the bar || index of the bar || The Symbol, the Timeframe, the Index || double | |||
|- | |||
| '''iClose(string Symbol, int Timeframe, int Index)''' || Get the Close value of the bar || index of the bar || The Symbol, the Timeframe, the Index || double | |||
|- | |||
| '''iTime(string Symbol, int Timeframe, int Index)''' || Get the Time (Date) value of the bar || index of the bar || The Symbol, the Timeframe, the Index || DateTime | |||
|- | |||
| '''iVolume(string Symbol, int Timeframe, int Index)''' || Get the Volume value of the bar || index of the bar || The Symbol, the Timeframe, the Index || int | |||
|- | |||
| '''iVolume(string Symbol, int Timeframe, int Index)''' || Get the Volume value of the bar || index of the bar || The Symbol, the Timeframe, the Index || int | |||
|} | |||
=== Indicator configuration functions === | === Indicator configuration functions === |
Revision as of 08:32, 5 January 2023
Summary
Constant parameters
Timeframes constants are used to set the values of timeframes
Series constants are used in function to set the mode of data access (open, low, close, high, volume or time)
Drawing styles constants are used in chart drawing functions to set the graph type (line, histogram, candles, ...)
Line styles constants are used in graphical objects functions to set the style of the line
Objects type constants are used in graphical objects functions to set the type of the object (rectangle, ellipse, horizontal line, ...)
Objects properties constants are used in graphical objects functions to set the property of the object (date value, price value, color, ...)
Applied Prices constants are mainly used in Moving Average functions to set the type of the Moving Average Price (Close, Median, Typical, Weighted, ...)
MA Method constants are mainly used in Moving Average functions to set the type of the Moving Average (SMA, EMA, SMMA or LWMA)
Data access functions
Here are the meta-data functions :
Function name | Description | Returned value |
---|---|---|
Symbol() | Get the current Symbol of the attached chart | string |
Period() | Get the current Timeframe of the attached chart | int |
Ask() | Get the current Ask value | double |
Bid() | Get the current Bid value | double |
Spread() | Get the current Spread value | double |
Digits() | Get the number of digits after the comma | double |
Point() | Get the minimum value of the Symbol | double |
Bars() | Get the number of bars on the attached chart | int |
Here are the data access functions related to the index :
Function name | Description | Parameter | Returned value |
---|---|---|---|
Open(int index) | Get the Open value of the bar | index of the bar | double |
High(int index) | Get the High value of the bar | index of the bar | double |
Low(int index) | Get the Low value of the bar | index of the bar | double |
Close(int index) | Get the Close value of the bar | index of the bar | double |
Time(int index) | Get the Time (Date) value of the bar | index of the bar | DateTime |
Volume(int index) | Get the Volume value of the bar | index of the bar | int |
These functions are used to have the value of a specific bar related to its index.
When the index is 0, this is the last bar.
When the index is 1, this is the previous last bar.
When the index is 2, this is the previous previous last bar. And so on.
The Symbol and the Timeframe are the ones related to the attached chart.
Here are the generic data access functions, specifying the Symbol or Timeframe :
Function name | Description | Parameters | Returned value | |
---|---|---|---|---|
iOpen(string Symbol, int Timeframe, int Index) | Get the Open value of the bar | The Symbol, the Timeframe, the Index | double | |
iHigh(string Symbol, int Timeframe, int Index) | Get the High value of the bar | index of the bar | The Symbol, the Timeframe, the Index | double |
iLow(string Symbol, int Timeframe, int Index) | Get the Low value of the bar | index of the bar | The Symbol, the Timeframe, the Index | double |
iClose(string Symbol, int Timeframe, int Index) | Get the Close value of the bar | index of the bar | The Symbol, the Timeframe, the Index | double |
iTime(string Symbol, int Timeframe, int Index) | Get the Time (Date) value of the bar | index of the bar | The Symbol, the Timeframe, the Index | DateTime |
iVolume(string Symbol, int Timeframe, int Index) | Get the Volume value of the bar | index of the bar | The Symbol, the Timeframe, the Index | int |
iVolume(string Symbol, int Timeframe, int Index) | Get the Volume value of the bar | index of the bar | The Symbol, the Timeframe, the Index | int |