版主,能不能幫忙看下,關(guān)于跟蹤止盈中最高價(jià)的傳遞問題 [開拓者 TB]
- 咨詢內(nèi)容:
SetGlobalVar(0,High);
SetGlobalVar(1,Low);
If(MarketPosition==1 and BarsSinceEntry>0)
HiAfterEntry=GetGlobalVar(0);
HiAfterEntry=Max(HiAfterEntry,High);
If(MarketPosition==-1 and BarsSinceEntry>0)
loafterentry=GetGlobalVar(1);
LoAfterEntry=Min(LoAfterEntry,Low);
Commentary("HiAfterEntry="+Text(HiAfterEntry));
Commentary("LoAfterEntry="+Text(LoAfterEntry));
不知道哪里出問題,最高價(jià)最低價(jià)根本傳遞不起來 - TB技術(shù)人員:
傳遞的一直都是當(dāng)前最高價(jià)或當(dāng)前最低價(jià)
- TB客服:
If(MarketPosition==1 and BarsSinceEntry==0)
HiAfterEntry=High;
If(MarketPosition==1 and BarsSinceEntry>=1)
HiAfterEntry=Max(HiAfterEntry,High);
If(MarketPosition==-1 and BarsSinceEntry==1)
LoAfterEntry=Low[1];
If(MarketPosition==-1 and BarsSinceEntry>1)
LoAfterEntry=Min(LoAfterEntry,Low);
Commentary("HiAfterEntry="+Text(HiAfterEntry));
Commentary("LoAfterEntry="+Text(LoAfterEntry));
這個(gè)是我當(dāng)時(shí)的另一種傳遞的寫法,也失敗了 - 網(wǎng)友回復(fù):
youyu8792 發(fā)表于 2012-6-4 14:22
If(MarketPosition==1 and BarsSinceEntry==0)
HiAfterEntry=High;
If(MarketPosition==1 and BarsSinceEnt ...
試試以下代碼
聲明兩個(gè)序列數(shù)值型變量,HiAfterEntry和LoAfterEntry。- if(buycondition)
- {
- buy();
- HiAfterEntry= high;
- }else
- {
- HiAfterEntry = max(HiAfterEntry[1],high);
- }
- ....
- if(sellcondition)
- {
- sellshort();
- LoAfterEntry = low;
- }else
- {
- LoAfterEntry = min(LoAfterEntry[1],low);
- }
- if(buycondition)
- 網(wǎng)友回復(fù):
謝謝,測(cè)試中,后來有用幫助里的例子,也算是成功了,但有個(gè)問題,這種傳遞在實(shí)盤中需要使用全局變量來弄嗎
如果以上指標(biāo)公式不適用于您常用的行情軟件
或者您想改編成選股公式,以便快速選出某種形態(tài)個(gè)股的話,
相關(guān)文章
-
沒有相關(guān)內(nèi)容