小米老大,與各位版主,我再麻煩一次 [開(kāi)拓者 TB]
- 咨詢內(nèi)容:
Vars
bool aa;
Bool bb;
Numeric tradBegin(905); 開(kāi)倉(cāng)時(shí)間
Numeric tradEnd(1458); 開(kāi)倉(cāng)截止時(shí)間
Bool conEntryReady;
Begin
aa = xxxxx;
bb = yyyyy;
conEntryReady=CurrentTime*100 >=tradBegin and CurrentTime*100<tradEnd and C-Q_LowerLimit>20*MinMove*PriceScale && Q_UpperLimit-C>20*MinMove*PriceScale;//不靠近漲跌停 //// 開(kāi)倉(cāng)時(shí)限
If(GetGlobalVar(0)==InvalidNumeric)
{
SetGlobalVar(0,0); \\0
SetGlobalVar(1,0); \\
}
If(BarStatus==2 and conEntryReady)
{
If( aa && A_GetOpenOrderCount==0 && A_BuyPosition==0 && GetGlobalVar(0)==0)
{
A_SendOrder(enum_buy,enum_entry,1,q_last);
SetGlobalVar(0,1);
setGlobalVar(1,0);
}
If( bb && A_GetOpenOrderCount==0 && A_BuyPosition>0 && GetGlobalVar(1)==0)
{
A_SendOrder(enum_sell,enum_exit,1,q_last);
SetGlobalVar(1,1);
SetGlobalVar(0,0);
}
}
Commentary("get0: get1:"+Text(getglobalvar(0))+","+text(getglobalvar(1)));
End
conEntryReady=CurrentTime*100 >=tradBegin and CurrentTime*100<tradEnd and C-Q_LowerLimit>20*MinMove*PriceScale && Q_UpperLimit-C>20*MinMove*PriceScale;//不靠近漲跌停 //// 開(kāi)倉(cāng)時(shí)限
我把這個(gè)conEntryReady入在If(BarStatus==2 and conEntryReady) 這里就不發(fā)單,是不是不應(yīng)該放在這里.
謝謝.... - TB技術(shù)人員:
本帖最后由 小米 于 2013-7-29 13:54 編輯
使用commentary("conentryready: "+iifstring(conentryready,"true","false")); 放到公式里,看一下在最后K線上的輸出值是什么? - TB客服:
那天看你見(jiàn)你的回貼,
Commentary("get0: get1:"+Text(getglobalvar(0))+","+text(getglobalvar(1)));
我就得到啟發(fā).然后我就在論壇查 bool的值,如何用Commentary輸出?
我都試過(guò)的.你看
//Commentary("aa="+IIFString(aa,"True","False"));
//Commentary("bb="+IIFString(bb,"True","False"));
commentary("conentryready: "+iifstring(conentryready,"true","false")); 這個(gè)也用過(guò)的.
我又在論壇查:如果用CurrentTime是取本地時(shí)間.而B(niǎo)ar是time時(shí)間
如果用回返,用Time 實(shí)盤(pán)是CurrentTime
所以,我早上在實(shí)盤(pán)中用CurrentTime 但是不發(fā)單.
- 網(wǎng)友回復(fù):
xiaosong 發(fā)表于 2013-7-29 15:12
那天看你見(jiàn)你的回貼,
Commentary("get0: get1:"+Text(getglobalvar(0))+","+text(getglobalvar(1)));
你現(xiàn)在的問(wèn)題是加入條件后不發(fā)單 ,那么需要查看的就是這個(gè)條件是否滿足。
加入我前面給出的語(yǔ)句后,看到的結(jié)果是什么呢??最后K線上顯示的是true還是false?
- 網(wǎng)友回復(fù):
本帖最后由 xiaosong 于 2013-7-29 15:57 編輯
是false
但是小米老大,現(xiàn)在的時(shí)間15.54 而B(niǎo)ar上面的時(shí)間是當(dāng)時(shí)的時(shí)間
現(xiàn)在去看是不是都是false了.
明天老大了..哎...
晚上我去試去了.
有思路,想編寫(xiě)各種指標(biāo)公式,程序化交易模型,選股公式,預(yù)警公式的朋友
可聯(lián)系技術(shù)人員 QQ: 1145508240 進(jìn)行 有償 編寫(xiě)!(不貴!點(diǎn)擊查看價(jià)格!)
相關(guān)文章
-
沒(méi)有相關(guān)內(nèi)容