想寫個 突破第一次開倉后的高點(diǎn)再加倉,但是圖標(biāo)上沒顯示 - TradeBlazer公式
作者:開拓者 TB 來源:cxh99.com 發(fā)布時間:2012年09月04日
- 咨詢內(nèi)容:
請大神們幫忙看下,
想寫個 突破第一次開倉后的高點(diǎn)再加倉,但是圖標(biāo)上沒顯示
謝謝
Params
numeric length1(20);
numeric atrlength(20);
numeric mindiff(0);
Numeric lots(1);
Numeric trailstop(1.5);
Vars
NumericSeries hhv;
NumericSeries llv;
numericseries atrvalue;
Numeric tmindiff;
NumericSeries hiafterentry;
NumericSeries loafterentry;
Begin
hhv=Highest(high,length1);
llv=Lowest(low,length1);
atrvalue=AvgTrueRange(atrlength);
tmindiff=mindiff*MinMove*PriceScale;
if(MarketPosition<>1 And high>=hhv[1])
{
Buy(lots,Max(open,hhv[1])+tmindiff);
}
if(marketposition<>-1 and low<=llv[1])
{
SellShort(lots,Min(low,llv[1])-tmindiff);
}
if(marketposition==1 and barssinceentry==0)
hiafterentry=high;
if (marketposition==1 and barssinceentry>=1)
hiafterentry=Max(high,hiafterentry);
if (marketposition==-1 and BarsSinceEntry==0);
loafterentry=low;
if (marketposition==-1 and BarsSinceEntry>=1)
loafterentry=Min(low,loafterentry);
if (marketposition==1 and barssinceentry>=1 and high>=hiafterentry[1])
{
buy(lots,max(open,hiafterentry)+tmindiff);
}
if (marketposition==-1 and barssinceentry>=1 and low<=loafterentry[1])
{
sellshort(lots,min(open,loafterentry)-tmindiff);
}
End
- TB技術(shù)人員:
別說LZ限制了加倉次數(shù)啊,,,,在交易設(shè)置里面