全部 智大领峰 TBQuant功能 TBL语言 TB开户 问答专区 高手圈 其他
已解决
帮忙看一下这个策略
yin888 分享到
2021-12-29 11:36

成交价格往往比触发价格高了10个点左右的滑点,客服说是以下问题

(虚假盈利,比如:价格超过100,我发单,,但是发单语句我写buy(0,90)用90元买入,这时候价格就不合理,,就是一种偷价行为,,虽然图表看到的是90的价格,但是实际发单还是会以100左右的价格,到时偏差)

 Params


            Numeric AfStep( 0.02);


            Numeric AfLimit( 0.2 ) ;


            Numeric Length(50);

            //均线周期


            Numeric Tiao(0);

            //跳数


            Numeric Lots(1);

            //仓量 


        


            Numeric lostPoint(100); // 50个点,止损


        
Vars


            Numeric oParCl( 0 ); 


            Numeric oParOp( 0 );


            Numeric oPosition( 0 ); 


            Numeric oTransition( 0 );


            NumericSeries sar; 


            Numeric ma;


            NumericSeries isDo;


            NumericSeries lastOpen; 
//

            NumericSeries sar;


            Numeric minpoint;


            NumericSeries myenterPrice;


            Numeric zhisunPrice;


        
Begin

            ma = AverageFC(Close[1],Length);


            ParabolicSAR( AfStep, AfLimit, oParCl, oParOp, oPosition, oTransition ) ;


            COMMENTARY("oParCl="+ Text(oParCl));


            // COMMENTARY("oParOp"+ Text(oParOp));


            // COMMENTARY("oPosition"+ Text(oPosition));


            // COMMENTARY("oTransition"+ Text(oTransition));


            // COMMENTARY("MarketPosition"+ Text(MarketPosition));


        


            // COMMENTARY("isDo[0]"+ Text(isDo));


            // COMMENTARY("isDo[1]"+ Text(isDo[1]));

            COMMENTARY("ma="+ Text(ma));

            PlotNumeric("oParCl" , oParCl);

            minpoint = MinMove*PriceScale;

            zhisunPrice = MinMove * PriceScale * lostPoint;

            isDo = oParCl - ma - 10 * Tiao;

            If(MarketPosition==1 ) 

            {

            // If(isDo[0] > 0 && isDo[1] <= 0){

            If(oParCl < L)

            {

            Sell(Lots, (h+l)/2);

            SellShort(Lots, (h+l)/2);

            lastOpen = O;

            }

            // zhisunPrice

            else if(close[1] > lastOpen + zhisunPrice)

            {

            sell(LOTS, open);

            }

            }


            Else If(MarketPosition==-1){

            If(oParCl > H)

            {

            BuyToCover(Lots, (h+l)/2);

            Buy(Lots, (h+l)/2);

            lastOpen = O;

            // zhisunPrice

            }

            else if (close[1] < lastOpen - zhisunPrice)

             {

            BuyToCover(LOTS,o);

            }

            }

            Else If(MarketPosition==0){


            If(oParCl < L)

            {

            Buy(Lots, O);

            lastOpen = O;

            }

        

            Else If(oParCl > H)

            {

            SellShort(Lots, O);

            lastOpen = O;

            }

            }


        


            End

yin888

有人吗

2021-12-29 13:24
kyover

你是不是开了委托偏移.....

2021-12-29 13:29
yin888
@kyover

好像是,不开的话会不会因为行情拉太快导致无法成交,不太熟悉开拓者,麻烦解答一下,谢谢你

2021-12-29 13:43
kongqj

这不是SAR策略吗?

2022-01-04 17:36
您未登录,请先 登录注册 后发表评论
顶部