图片内容看下,报错,怎么改,谢谢大佬指点。
- bool 对冲操作=(id==CHARTEVENT_OBJECT_CLICK&&sparam=="开多价差")+(id==CHARTEVENT_OBJECT_CLICK&&sparam=="开空价差")+(id==CHARTEVENT_OBJECT_CLICK&&sparam=="平多价差尾")+(id==CHARTEVENT_OBJECT_CLICK&&sparam=="平空价差尾")+(id==CHARTEVENT_OBJECT_CLICK&&sparam=="多价差折仓")+(id==CHARTEVENT_OBJECT_CLICK&&sparam=="空价差折仓");
- if(对冲操作)
- {
- bool 检测1=交易.币种标识符检测(币种x,false,5,false,false);//---Oninit 使用
- bool 检测2=交易.币种标识符检测(币种y,false,5,false,false);//---Oninit 使用
- 对冲操作=对冲操作 && 检测1 && 检测2;
- }
- if(对冲操作)
- {
- if(id==CHARTEVENT_OBJECT_CLICK&&sparam=="开多价差")
- {
- ObjectSetString(0,"响应栏",OBJPROP_TEXT,"开多价差"+(string)做单手数);
- 交易.做多(币种x,做单手数,0,0,magic号码2,币种x+"面板做多价差buy");
- 交易.做空(币种y,做单手数,0,0,magic号码2,币种y+"面板做多价差sell");
- }
- //---
- if(id==CHARTEVENT_OBJECT_CLICK&&sparam=="开空价差")
- {
- ObjectSetString(0,"响应栏",OBJPROP_TEXT,"开空价差"+(string)做单手数);
- 交易.做空(币种x,做单手数,0,0,magic号码2,币种x+"面板做空价差sell");
- 交易.做多(币种y,做单手数,0,0,magic号码2,币种y+"面板做空价差buy");
- }
- //---
- if(id==CHARTEVENT_OBJECT_CLICK&&sparam=="平多价差尾")
- {
- ObjectSetString(0,"响应栏",OBJPROP_TEXT,"平多价差尾");
- 交易.平多尾单(币种x,magic号码2);
- 交易.平空尾单(币种y,magic号码2);
- }//---
- if(id==CHARTEVENT_OBJECT_CLICK&&sparam=="平空价差尾")
- {
- ObjectSetString(0,"响应栏",OBJPROP_TEXT,"平空价差尾");
- 交易.平空尾单(币种x,magic号码2);
- 交易.平多尾单(币种y,magic号码2);
- }
- //--
- if(id==CHARTEVENT_OBJECT_CLICK&&sparam=="多价差折仓")
- {
- ObjectSetString(0,"响应栏",OBJPROP_TEXT,"多价差折仓"+(string)多价差减仓比值);
- 交易.折多仓(币种x,magic号码2,0,多价差减仓比值,"面板多价差减仓"+(string)多价差减仓比值);
- 交易.折空仓(币种y,magic号码2,0,多价差减仓比值,"面板多价差减仓"+(string)多价差减仓比值);
- }
- //---
- if(id==CHARTEVENT_OBJECT_CLICK&&sparam=="空价差折仓")
- {
- ObjectSetString(0,"响应栏",OBJPROP_TEXT,"空价差折仓"+(string)空价差减仓比值);
- 交易.折空仓(币种x,magic号码2,0,空价差减仓比值,"面板空价差减仓"+(string)空价差减仓比值);
- 交易.折多仓(币种y,magic号码2,0,空价差减仓比值,"面板空价差减仓"+(string)空价差减仓比值);
- }
- }
复制代码
|