|
本帖最后由 双面佛 于 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[1]<0.2100)){
- isFirstBarsInday = true;
- }Else{
- isFirstBarsInday = false;
- }
-
- int i=0;
- for(;i<100000;i++){
- if(isFirstBarsInday[i]){
- Break;
- }
- }
-
- int color = Rgb(70,70,70);
-
- PartLine("left", i,Open[i], i, Close,color);
- PartLine("bottom", i, Open[i], 0, Open[i], color);
- PartLine("top", i, Close, 0, Close, color);
- if(!isFirstBarsInday){
- UnPlotPartLine("right",1);
- }
- PartLine("right", 0, Open[i], 0, Close, color);
-
- /*
- if(Close>Open[i]){
- color = ColorUp;
- }else if(Close<Open[i]){
- 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
复制代码
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册入住
x
|