有一个错误编译失败 大佬看看是啥
//+----------------------------------------
有一个错误编译失败 大佬看看是啥
//+------------------------------------------------------------------+
//| CustomPips.mq4 |
//| Copyright 2023, MetaQuotes Software Corp. |
//| http://www.metaquotes.net/ |
//+------------------------------------------------------------------+
#property copyright "Your Name"
#property link "http://www.yourwebsite.com"
#property version "1.00"
#property strict
#property indicator_separate_window // 允许在单独的窗口中显示指标
#property indicator_buffers 1 // 定义一个缓冲区,用于绘制水平线
#property indicator_color1 clrGreen // 定义缓冲区1的颜色为绿色
// 输入参数
input double PriceA = 1.0000; // 用户输入的价格A
input double PriceB = 0.5000; // 用户输入的价格B
// 定义指标缓冲区
double levelsBuffer[];
//+------------------------------------------------------------------+
//| CustomPips indicator initialization function |
//+------------------------------------------------------------------+
int OnInit()
{
// 计算A和B的差值
double diff = PriceA - PriceB;
// 定义水平线的倍数
int multipliers[] = {2, 3, 5, 7, 9}; // 差值的倍数
for(int i = 0; i < sizeof(multipliers); i++)
{
double level = PriceA + diff * multipliers[i];
levelsBuffer[i] = level; // 将计算出的级别存储在缓冲区中
}
return(INIT_SUCCEEDED); // 返回INIT_SUCCEEDED表示初始化成功
}
//+------------------------------------------------------------------+
|
|
|
|
|