分钟小时线隔日框
本帖最后由 双面佛 于 2021-4-25 15:21 编辑效果如下:
代码如下:
//------------------------------------------------------------------------
// 简称:日线分割框
// 名称:test4
// 类别: 交易指令
// 类型: 用户应用
//------------------------------------------------------------------------
Params
//参数定义
GlobalVars
//全局变量定义
Vars
//局部变量定义
BoolSeries isFirstBarsInday;
Begin
//策略执行区
if(BarType<2 || BarType>5){
return ;
}
If(Time==0.2100 || (Time==0.0900 && Time<0.2100)){
isFirstBarsInday = true;
}Else{
isFirstBarsInday = false;
}
int i=0;
for(;i<100000;i++){
if(isFirstBarsInday){
Break;
}
}
int color = Rgb(70,70,70);
PartLine("left", i,Open, i, Close,color);
PartLine("bottom", i, Open, 0, Open, color);
PartLine("top", i, Close, 0, Close, color);
if(!isFirstBarsInday){
UnPlotPartLine("right",1);
}
PartLine("right", 0, Open, 0, Close, color);
/*
if(Close>Open){
color = ColorUp;
}else if(Close<Open){
color = ColorDown;
}Else{
color = White;
}
PartLine("left", i,LowD(0), i, HighD(0),color);
PartLine("bottom", i, LowD(0), 0, LowD(0), color);
PartLine("top", i, HighD(0), 0, HighD(0), color);
if(!isFirstBarsInday){
UnPlotPartLine("right",1);
}
PartLine("right", 0, LowD(0), 0, HighD(0), color);*/
SetShapeStyle("left", 1, 3);
End
页:
[1]