设为首页收藏本站

 找回密码
 注册
查看: 1437|回复: 3
打印 上一主题 下一主题

老师,怎么解决小括号不匹配 [复制链接]

Rank: 1

精华
0
UID
273947
积分
12
帖子
6
主题
4
阅读权限
10
注册时间
2018-12-24
最后登录
2020-4-23
跳转到指定楼层
1#
发表于 2018-12-26 14:45:14 |只看该作者 |倒序浏览
if  (AlertEnabled And Close up through (UpLine2))
        {
                Alert("Do Alert "BUY");
        }
if  (AlertEnabled Close down throughr UpLine2))
        {
                Alert("Do Alert "SellShort");
        }
if  (AlertEnabled Close up through DownLine2))
        {
                Alert("Do Alert "BUY");
        }
if (AlertEnabled Close down throughr DownLine2))
        {
                Alert("Do Alert "SellShort");
        }

Rank: 10Rank: 10Rank: 10

精华
3
UID
5
积分
26584
帖子
12686
主题
49
阅读权限
200
注册时间
2007-7-20
最后登录
2021-11-3
2#
发表于 2018-12-26 15:00:10 |只看该作者
这是哪里来的代码呢?
这不是TB的语法啊。

使用道具 举报

Rank: 1

精华
0
UID
273947
积分
12
帖子
6
主题
4
阅读权限
10
注册时间
2018-12-24
最后登录
2020-4-23
3#
发表于 2018-12-26 15:09:19 |只看该作者
小米 发表于 2018-12-26 15:00
这是哪里来的代码呢?
这不是TB的语法啊。

Params
        Numeric Length(26);
        Numeric Offset(2);
Vars
        Numeric UpLine;                               //上轨
    Numeric UpLine2;                  //上中轨
        Numeric DownLine;                         //下轨
    Numeric DownLine2;               //下中轨
        NumericSeries MidLine;              //中间线
        Numeric Band;
Begin
        MidLine = AverageFC(Close,Length);
        Band = StandardDev(Close,Length,2);
        UpLine = MidLine + Offset * Band;
    DownLine = MidLine - Offset * Band;
        UpLine2 =(MidLine + UpLine)/2;
        DownLine2=(MidLine+DownLine)/2;
        PlotNumeric("上",UpLine);
        PlotNumeric("下",DownLine);
        PlotNumeric("中",MidLine);
    PlotNumeric("上中",UpLine2);
PlotNumeric("下中",DownLine2);
if (AlertEnabled & & Close Uplot CrossOver UpLine2))
        {
                Alert("Do Alert "BUY");
        }
if  (AlertEnabled Close DownTo CrossOver UpLine2))
        {
                Alert("Do Alert "SellShort");
        }
if  (AlertEnabled Close Close Uplot CrossOver DownLine2))
        {
                Alert("Do Alert "BUY");
        }
if (AlertEnabled Close DownTo CrossOver DownLine2))
        {
                Alert("Do Alert "SellShort");
        }


End
我想收盘价上穿上中轨做多,下穿上中轨做空,以下类似
下面的代码怎么修改以下

使用道具 举报

Rank: 10Rank: 10Rank: 10

精华
3
UID
5
积分
26584
帖子
12686
主题
49
阅读权限
200
注册时间
2007-7-20
最后登录
2021-11-3
4#
发表于 2018-12-26 15:17:56 |只看该作者
damorenjia 发表于 2018-12-26 15:09
Params
        Numeric Length(26);
        Numeric Offset(2);
  1. if (AlertEnabled & & crossover(close, UpLine2)) //上穿使用函数crossover
  2.         {
  3.                 Alert("Do Alert "BUY");
  4.         }
  5. if  (AlertEnabled  && crossunder(close,UpLine2))  //下穿使用函数crossunder
  6.         {
  7.                 Alert("Do Alert "SellShort");
  8.         }
复制代码
建议先看一下软件帮助文 档,熟悉一下软件的基础 语法。。

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

bottom

静态版|手机版|联系我们|交易开拓者 ( 粤ICP备07044698   

GMT+8, 2024-5-8 16:33

Powered by Discuz! X2 LicensedChrome插件扩展

© 2011-2012 交易开拓者 Inc.

回顶部