![]() |
在這個頁面顯示本主題全部的 1 個文章 |
奇狐社區論壇 (http://www.chiefox.com.tw/bbs/index.php)
- 問題交流 (http://www.chiefox.com.tw/bbs/forumdisplay.php?forumid=28)
-- [問題]請問板上各位高手以下測試系統要如何改成每個月1號結算上個月的績效 (http://www.chiefox.com.tw/bbs/showthread.php?threadid=7509)
[問題]請問板上各位高手以下測試系統要如何改成每個月1號結算上個月的績效
//////////////////////////////////////////// 以上是你自己欲測式的指標,可變換
//////////////////////////// 以下是測試系統,可代入
tjb1:= //填入買入條件
tjs1:=//填入賣出條件
variable:b=0;
tjb:=0*close;
tjs:=tjb;
for i=max(lbound(tjb1),lbound(tjs1)) to datacount do begin
if b=0 and tjb1[i] then begin
b:=1; tjb[i]:=1;
end else
if b=1 and tjs1[i] then begin
b:=0; tjs[i]:=1;
end;
end;
//drawicon(tjb,RSI,10),align5; //過濾買點
//drawicon(tjs,RSI,11),align5; //過濾賣點
紅數:=count(tjb,0);
綠數:=count(tjs,0);
初紅:=barssince(tjb);
初綠:=barssince(tjs);
末紅:=barslast(tjb);
末綠:=barslast(tjs);
s1:=sum(if(tjb,C,0),0); //自表頭開始符合買多條件之收盤價總和
s2:=sum(if(tjs,C,0),0); //自表頭開始符合買空條件之收盤價總和
s5:=ref(C,初紅);
s6:=ref(C,初綠);
s7:=ref(C,末紅);
s8:=ref(C,末綠);
做多回數:=if((紅數=綠數 and 初紅>初綠) or (紅數<>綠數 and 初紅<初綠),紅數,紅數-1);
做空回數:=if((紅數=綠數 and 初紅>初綠) or (紅數<>綠數 and 初紅<初綠),綠數-1,綠數);
總交易回數:=做多回數+做空回數,linethick0;
買多:=if((紅數=綠數 and 初紅>初綠) or (紅數<>綠數 and 初紅<初綠),s1,s1-s7);
多平:=if((紅數=綠數 and 初紅>初綠) or (紅數<>綠數 and 初紅<初綠),s2,s2-s6);
買空:=if((紅數=綠數 and 初紅>初綠) or (紅數<>綠數 and 初紅<初綠),s2-s8,s2);
空平:=if((紅數=綠數 and 初紅>初綠) or (紅數<>綠數 and 初紅<初綠),s1-s5,s1);
做多盈虧:=多平-買多;
做空盈虧:=買空-空平;
總盈虧:=做多盈虧+做空盈虧;
explain(islastbar,'\n買訊: '+numtostr(紅數,0)+' 回');
explain(islastbar,'賣訊: '+numtostr(綠數,0)+' 回');
explain(islastbar,'\n做多回數: '+numtostr(做多回數,0)+' 回'),colormagenta;
explain(islastbar,'做空回數: '+numtostr(做空回數,0)+' 回'),colorcyan;
explain(islastbar,'總交易回數: '+numtostr(總交易回數,0)+' 回'),colorred;
explain(islastbar,'\n做多總交易: '+numtostr(買多,0)+' 點'),colormagenta;
explain(islastbar,'多平總交易: '+numtostr(多平,0)+' 點'),colorcyan;
explain(islastbar,'做多盈虧: '+numtostr(做多盈虧,0)+' 點'),colorred;
explain(islastbar,'\n做空總交易: '+numtostr(買空,0)+' 點'),colormagenta;
explain(islastbar,'空平總交易: '+numtostr(空平,0)+' 點'),colorcyan;
explain(islastbar,'做空盈虧: '+numtostr(做空盈虧,0)+' 點'),colorred;
explain(islastbar,'\n總結盈虧: '+numtostr(總盈虧,0)+' 點'),colorwhite;
explain(islastbar,'\n統計週數: '+numtostr(barpos/5,0)+' 週');
explain(islastbar,'平均週獲利: '+numtostr(總盈虧/(barpos/5),2)+' 點'),colorred;
全部時間均為台灣時間, 現在時間為06:03 | 在這個頁面顯示本主題全部的 1 個文章 |
Powered by: vBulletin Version 2.3.0 - Copyright©2000-, Jelsoft Enterprises Limited.
簡愛洋行 製作 Copyright 2003-. All Rights Reserved.