想寫個 突破第一次開倉后的高點再加倉,但是圖標上沒顯示 - TradeBlazer公式 [開拓者 TB]
- 咨詢內容:
請大神們幫忙看下,
想寫個 突破第一次開倉后的高點再加倉,但是圖標上沒顯示
謝謝
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技術人員: 別說LZ限制了加倉次數啊,,,,在交易設置里面
有思路,想編寫各種指標公式,程序化交易模型,選股公式,預警公式的朋友
可聯系技術人員 QQ: 262069696 進行 有償 編寫!(不貴!點擊查看價格!)
- 上一篇:close[-3]寫法對嗎
- 下一篇:請問下大家手續費和沖擊成本的問題
相關文章
-
指定的模型還沒有相關內容!