期貨期權交流自己編的mro公式
作者:MC 來源:cxh99.com 發布時間:2016年06月25日
- 咨詢內容:
感覺我這個邏輯更簡短和易理解
Input:condition(TrueFalseSeries),period(NumericSimple),times(NumericSimple);
var:record(0);
record=0;
if (times<=period and times>0) then // times就是自己要求的向左邊數起第幾次條件成立
begin
for value1=0 to (period-1)
begin
if condition[value1] then
begin
value2=value1;//循環中,每次滿足條件 ,將回溯點存儲起來
record=record+1;//循環中,每次滿足條件,都加1記錄起來
if record=times then
break; //一旦記錄的次數達到參數指定的times ,中斷循環
end;
end;
end;
if (record < 1 or record<times) then
mymrotimes=-1 //一旦記錄的次數小于1 (即一次條件都沒有滿足) 或者小于指定的times時 ,函數mymrotimes=-1,因為沒有 達到我們想要的要求
else
mymrotimes=value2;
已經核對過 和mro功能一樣 其實我發現
-
QQ截圖20150722142637.png
(10.04 KB, 下載次數: 2)
2015-7-22 14:27 上傳
點擊文件名下載附件
- MC技術部:
感謝分享啊~~