Data Types
nan
Represents the keyword "unavailable," indicating that a variable has not been assigned a value.
Syntax version required // @version=2
Example
int a = nan ;
b = na(a) ; // true
var
"var" is a keyword used to allocate and initialize variables in one step.
Syntax version required // @version=2
Example
var int a = 4;
var b = nan;
var c; // c has no value and cannot be calculated
varip
"varip" is a keyword used to allocate and initialize variables in one step. Variables and fields declared with varip retain their values between script executions on the same root K-line and are updated in real-time K-lines.
Syntax version required // @version=2
Example
varip int a = 4;
varip b = nan; // any type
varip c; // c has no value and cannot be calculated
int
Integer type
Syntax version required // @version=2
Example
int a = 4;
a = 4; // Judged as int type
float
Floating point number type
Syntax version required // @version=2
Example
float a = 4.0;
a = 4.0; // Judged as float type
string
String type
Syntax version required // @version=2
Example
string a = '4';
bool
Boolean type, with the values true and false
Syntax version required // @version=2
Example
bool a = true;
a = true;
bool b = false;
b = false;
Function Definition
func
Custom function structure
Example
ma10 = ma(close,10)
func_ma(x,y) {
sum = 0.0 ;
for (i = 0; i < y; i++){
sum := sum + x[i]/y ;
}
return sum ;
}
func_ma10 = func_ma(close, 10) ;
Related Reading:
AICoin Custom Indicator Function Documentation—Market Data
AICoin Custom Indicator Function Documentation—Indicator Functions
AICoin Custom Indicator Function Documentation—Calculation Functions
AICoin Custom Indicator Function Documentation—Configuration and Trading Functions
Function Documentation—Drawing, Alerts, and Conditional Expressions
AICoin Custom Indicator Function Documentation—Summary of Operators
免责声明:本文章仅代表作者个人观点,不代表本平台的立场和观点。本文章仅供信息分享,不构成对任何人的任何投资建议。用户与作者之间的任何争议,与本平台无关。如网页中刊载的文章或图片涉及侵权,请提供相关的权利证明和身份证明发送邮件到support@aicoin.com,本平台相关工作人员将会进行核查。