全部 智大领峰 TBQuant功能 TBL语言 TB开户 问答专区 高手圈 其他
帮忙修改下公式,显示缺少分号,不太懂tb公式,谢谢
yin888 分享到
2021-10-15 11:57


Params 
 
        Numeric AfStep(0.02); 
 
        Numeric AfLimit(0.2) ; 
 
        Numeric malen(120); 
 
        Numeric stopLoss(1); 
 
        Numeric BuyLots(1); 
 
        Numeric offset(0); 
 
Vars 
 
        Numeric oParCl( 0 ); 
 
        Numeric oParOp( 0 ); 
 
        Numeric oPosition( 0 ); 
 
        Numeric oTransition( 0 ); 
 
        Series<Numeric> oParOp_s; 
 
        Numeric oParOp_p; 
 
        Numeric i_offset; 
 
        Numeric ma; 
 
        Bool bUpline; 
 
        string strkey; 
 
        string strValue; 
 
        Numeric i_stopLoss; 
 
        
 
Begin 
 
  
 
        ma = Average(Open,malen); 
 
        bUpline = Open>= ma; 
 
        ParabolicSAR( AfStep, AfLimit, oParCl, oParOp, oPosition, oTransition ) ; 
 
        oParOp_s = oParOp; 
 
        oParOp_p = oParOp_s[1]; 
 
        i_offset = offset*MinMove*PriceScale; 
 
        i_stopLoss = stopLoss*(OpenD(0)/100); 
 
        
 
        Commentary("oParOp:"+Text(oParOp)); 
 
        Commentary("oTransition:"+Text(oTransition)); 
 
        Commentary("oPosition:"+Text(oPosition)); 
 
If(CurrentBar>malen) 
 

 
        PlotNumeric("oParCl",oParCl); 
 
        If(malen != 0) 
 
        { 
 
                PlotNumeric("ma",ma); 
 
        } 
 
  
 
  
 
        If(MarketPosition == 0) 
 
        { 
 
                If(malen == 0) 
 
                { 
 
                        bUpline = True; 
 
                } 
 
  
 
                If(oTransition == 1 and bUpline) 
 
                { 
 
                        Buy(BuyLots,Max(Open,oParOp_p)+i_offset); 
 
                        Return; 
 
                } 
 
                
 
                If(malen == 0) 
 
                { 
 
                        bUpline = False; 
 
                } 
 
  
 
                If(oTransition == -1 and bUpline==False) 
 
                { 
 
                        SellShort(BuyLots,Min(Open,oParOp_p)-i_offset); 
 
                        Return; 
 
                } 
 
        } 
 
  
 
        If(MarketPosition == 1) 
 
        { 
 
                If(malen == 0) 
 
                { 
 
                        bUpline = False; 
 
                } 
 
                
 
                If(LastEntryPrice-Low>=i_stopLoss) 

yin888

有哪位兄弟帮忙看一下吗

2021-10-15 12:31
kyover

你这个也没发全啊

2021-10-15 12:54
您未登录,请先 登录注册 后发表评论
顶部