期貨期權(quán)交流自己編的mro公式 [MC]
- 咨詢內(nèi)容:
感覺我這個邏輯更簡短和易理解
Input:condition(TrueFalseSeries),period(NumericSimple),times(NumericSimple);
var:record(0);
record=0;
if (times<=period and times>0) then // times就是自己要求的向左邊數(shù)起第幾次條件成立
begin
for value1=0 to (period-1)
begin
if condition[value1] then
begin
value2=value1;//循環(huán)中,每次滿足條件 ,將回溯點(diǎn)存儲起來
record=record+1;//循環(huán)中,每次滿足條件,都加1記錄起來
if record=times then
break; //一旦記錄的次數(shù)達(dá)到參數(shù)指定的times ,中斷循環(huán)
end;
end;
end;
if (record < 1 or record<times) then
mymrotimes=-1 //一旦記錄的次數(shù)小于1 (即一次條件都沒有滿足) 或者小于指定的times時 ,函數(shù)mymrotimes=-1,因?yàn)闆]有 達(dá)到我們想要的要求
else
mymrotimes=value2;
已經(jīng)核對過 和mro功能一樣 其實(shí)我發(fā)現(xiàn)
-
QQ截圖20150722142637.png (10.04 KB, 下載次數(shù): 2)
2015-7-22 14:27 上傳
點(diǎn)擊文件名下載附件
-
- MC技術(shù)部: 感謝分享啊~~
有思路,想編寫各種指標(biāo)公式,程序化交易模型,選股公式,預(yù)警公式的朋友
可聯(lián)系技術(shù)人員 QQ: 511411198 進(jìn)行 有償 編寫!(不貴!點(diǎn)擊查看價格!)
相關(guān)文章
-
沒有相關(guān)內(nèi)容