函数Print()学习
void Print(
argument, // first value
… // next values
);
Parameters
[in] Any values separated by commas. The number of parameters cannot exceed 64.
Note
Arrays cannot be passed to the Print() function. Arrays must be input element-by-element.
例子1
- Print("c=",c, " Pi=",M_PI, " (float)M_PI=",(float)M_PI);
- // c=3.14159 Pi=3.141592653589793 (float)M_PI=3.14159
复制代码 预定义Bars学习Number of bars in the current chart.
例子2 - printf(Bars);
- //2018.11.28 10:36:48.160 柱体标号索引学习 EURUSD,H1: 2221
- //2018.11.28 10:35:55.080 柱体标号索引学习 EURUSD,H4: 8031
- //2018.11.28 10:36:26.926 柱体标号索引学习 EURUSD,Daily: 2049
复制代码例子3 - int counter=1;
- for(int i=1; i<=Bars; i++)
- {
- Print(Close[i-1]);
- }
- /*
- 0 10:57:08.496 柱体标号索引学习 EURUSD,Monthly: 1.12909
- 0 10:57:08.496 柱体标号索引学习 EURUSD,Monthly: 1.1313
- 0 10:57:08.496 柱体标号索引学习 EURUSD,Monthly: 1.16021
- 0 10:57:08.496 柱体标号索引学习 EURUSD,Monthly: 1.16069
- 0 10:57:08.496 柱体标号索引学习 EURUSD,Monthly: 1.16898
- 0 10:57:08.496 柱体标号索引学习 EURUSD,Monthly: 1.16816
- 0 10:57:08.496 柱体标号索引学习 EURUSD,Monthly: 1.1691
- 0 10:57:08.496 柱体标号索引学习 EURUSD,Monthly: 1.20767
- 0 10:57:08.496 柱体标号索引学习 EURUSD,Monthly: 1.23257
- .....
- 0 10:57:08.496 柱体标号索引学习 EURUSD,Monthly: 1.1091
- 0 10:57:08.496 柱体标号索引学习 EURUSD,Monthly: 1.1334
- 0 10:57:08.496 柱体标号索引学习 EURUSD,Monthly: 1.1113
- 0 10:57:08.496 柱体标号索引学习 EURUSD,Monthly: 1.0819
- 0 10:57:08.496 柱体标号索引学习 EURUSD,Monthly: initialized
- */
复制代码函数iBars()学习
int iBars( string symbol, // symbol int timeframe // timeframe ); Parameters symbol [in] Symbol the data of which should be used to calculate indicator. NULL means the current symbol. timeframe [in] Timeframe. It can be any of ENUM_TIMEFRAMES enumeration values. 0 means the current chart timeframe. Returned value The number of bars on the specified chart. 例子4 - rint("Bar count on the 'EURUSD,H1' is ",iBars("EURUSD",PERIOD_H1));
- //2018.11.28 10:38:16.128 柱体标号索引学习 EURUSD,H4: Bar count on the 'EURUSD,H1' is 2221
- //2018.11.28 10:38:37.721 柱体标号索引学习 EURUSD,H1: Bar count on the 'EURUSD,H1' is 2221
复制代码
|