請(qǐng)版主幫忙解決一下程序信號(hào)閃爍的問題 [開拓者 TB]
- 咨詢內(nèi)容:
Params
Numeric notaft(14.58);
Vars
Numericseries High5(0);//
Numericseries Low5(0);//
Numeric Value1;//
Numericseries ennight;//
Numericseries enday;//
begin
Value1=Average(Close,10);
if (time>=0.210000 && time<=0.21045959)
{
High5=Highest(High,5);
Low5=Lowest(Low,5);
}
PlotNumeric("5分鐘高點(diǎn)",High5,0,White);
PlotNumeric("5分鐘低點(diǎn)",Low5,0,White);
//開倉//程序化交易
if(date!=date[1])
{
ennight=0;
enday=0;
}
if(MarketPosition==0 and Close>High5 and Low<=High5 )
if(time>0.1600 and Time<0.2400 && ennight<1)
{
buy(1,Close);
ennight= ennight[1]+1;
}else if ( time>0.0900 and time<0.1500 && enday<1)
{
buy(1,Close);
enday = enday[1]+1;
}
if(MarketPosition==0 and Close<low5 and High>=low5 )
if(time>0.1600 and Time<0.2400 && ennight<1)
{
SellShort(1,Close);
ennight= ennight[1]+1;
}else if ( time>0.0900 and time<0.1500 && enday<1)
{
SellShort (1,Close);
enday = enday[1]+1;
}
//止損
if (MarketPosition==1 and Close<Value1 )
{
sell(1,low);
}
if (MarketPosition==-1 and Close>Value1)
{
BuyToCover(1,High);
}
//收盤平倉
if(Time*100>=notaft and Time<0.1600)
{
if(marketposition==-1)
{
BuyToCover(1,Open);
}
if(marketposition==1)
{
Sell(1,Open);
}
}
End - TB技術(shù)人員: buy開倉函數(shù)不能直接用close,high,low之類的,因?yàn)閷?shí)時(shí)數(shù)據(jù)中bar沒走完這些值是會(huì)變化的,open則不會(huì)變。
有思路,想編寫各種指標(biāo)公式,程序化交易模型,選股公式,預(yù)警公式的朋友
可聯(lián)系技術(shù)人員 QQ: 511411198 進(jìn)行 有償 編寫!(不貴!點(diǎn)擊查看價(jià)格!)
相關(guān)文章
-
沒有相關(guān)內(nèi)容