好心人 幫幫忙啊 [開拓者 TB]
- 咨詢內(nèi)容: 老師你好 我有個公式 現(xiàn)在想疊加另外一個品種 比如在糖1301上疊加RU1301 要兩個同時滿足公式中的條件 才開倉糖1301 這個要怎么寫呢?
params
Numeric lots(1); //手數(shù)
vars
NumericSeries baramount;
NumericSeries barvol;
numericseries dayavg;
Begin
if(date!=Date[1])
{
baramount=close*Vol;
barvol=vol;
}
else
{
baramount = baramount[1]+close*vol;
barvol = barvol[1]+vol;
}
dayavg = baramount / barvol;
PlotNumeric("DayAvg",dayavg);
if ( time>=0.145900 )
{
if ( close[1]<dayavg[1])
Buy(lots,open);
Else If(close[1]>dayavg[1])
SellShort(lots,Open);
}
{
if( O>C[1] and date!=date[1] and MarketPosition>=1 )
{
sell(0,Open);
Commentary("買入價"+Text(Open));
}Else If( O<C[1] and date!=date[1] and MarketPosition<=-1 )
{
BuyToCover(0,Open);
Commentary("買入價"+Text(Open));
}
}
Commentary("dayavg="+Text(dayavg));
End
- TB技術(shù)人員: 在圖表上疊加合約后,在公式里寫上帶有data1數(shù)據(jù)源的判斷條件。
- TB客服: 不好意思 怎么改呢?我是菜鳥啊 幫我完整的寫出來 謝謝老師
- 網(wǎng)友回復(fù):
陳良利 發(fā)表于 2012-9-24 14:44
不好意思 怎么改呢?我是菜鳥啊 幫我完整的寫出來 謝謝老師
新手建議先看看這里http://bbs.tradeblazer.net/thread-16151-1-1.html - 網(wǎng)友回復(fù): 看了還不會啊 幫我完整的寫出來 謝謝老師
有思路,想編寫各種指標公式,程序化交易模型,選股公式,預(yù)警公式的朋友
可聯(lián)系技術(shù)人員 QQ: 262069696 進行 有償 編寫!(不貴!點擊查看價格!)
相關(guān)文章
-
沒有相關(guān)內(nèi)容