diff --git a/designer/udesignerproject.tsf b/designer/udesignerproject.tsf index a34853b..37d7ccc 100644 --- a/designer/udesignerproject.tsf +++ b/designer/udesignerproject.tsf @@ -1846,7 +1846,8 @@ end end function GetVCLdir(); begin - return Getfuncextdir()+ioFileseparator()+"tvclib"; + //return Getfuncextdir()+ioFileseparator()+"tvclib"; + return Getfuncextdir();//+ioFileseparator()+"tvclib"; return tsl; end function Getfuncextdir(); diff --git a/funcext/tvclib/utslvcldlg.tsf b/funcext/tvclib/utslvcldlg.tsf index 7ce193b..9834a74 100644 --- a/funcext/tvclib/utslvcldlg.tsf +++ b/funcext/tvclib/utslvcldlg.tsf @@ -1294,7 +1294,6 @@ type TEditAndBtnUni=class(tcustomcontrol) function DoControlAlign();override; begin c := clientRect; - echo tostn(c); FBtn.SetBoundsRect(array(C[2]-18,1,C[2]-3,c[3]-2)); FText.SetBoundsRect(array(c[0]+1,c[1]+1,c[2]-22,c[3]-2)); end diff --git a/funcext/tvclib/utslvclpage.tsf b/funcext/tvclib/utslvclpage.tsf index 8e61399..c1b9aff 100644 --- a/funcext/tvclib/utslvclpage.tsf +++ b/funcext/tvclib/utslvclpage.tsf @@ -58,14 +58,29 @@ type tcustompagecontrol = class(TCustomControl) FTabRects; FClientarea; private + function gettabsheetitem(idx); + begin + if idx>=0 and idx=0 then return FTabItems[idx]; + if idx>=0 and idx=0 then return FTabItems[id]; + if id>=0 then return FTabItems[id].PageSheet; end function SetTabPosition(v); begin @@ -471,6 +486,12 @@ type tcustompagecontrol = class(TCustomControl) end return r; end + function checknewchild(achild);override;//检查child + begin + r := inherited; + if isacceptsheettype( achild) then achild.Align := alNone; + return r; + end function getsheetrect(); //获得sheet begin {** @@ -625,25 +646,25 @@ type tcustompagecontrol = class(TCustomControl) CalcTabs(); for i := 0 to FTabItems.length()-1 do begin - it := FTabItems[i]; - pg := it.PageSheet; - if it and pg then + pg := FTabItems[i].PageSheet; + if not pg then continue; + pg.Align := alNone; + if i=FCurrentid then begin - if i=FCurrentid then + pg.Visible := true; + rc := getsheetrect(); + if not rc then return ; + rc[1]+=1; + if csDesigning in ComponentState then begin - pg.Visible := true; - rc := getsheetrect(); - if not rc then return ; - rc[1]+=1; - if csDesigning in ComponentState then - begin - rc[0]+=2; - rc[2]-=2; - rc[3]-=2; - end - pg.SetBoundsrect(rc); - end else - pg.Visible := false; + rc[0]+=2; + rc[2]-=2; + rc[3]-=2; + end + pg.SetBoundsrect(rc); + end else + begin + pg.Visible := false; end end end @@ -726,6 +747,7 @@ type tcustompagecontrol = class(TCustomControl) property TabCount read GetTabCount; property TabPosition:tabalign read FTabPosition write SetTabPosition; property tabsheet read gettabesheet ; + property tabsheetitem:tcustomtabitem read gettabsheetitem; property onmeasuretabwidth:eventhandler read fonmeasuretabwidth write fonmeasuretabwidth; property ondrawtab:eventhandler read fondrawtab write fondrawtab; property ownerdraw:bool read fownerdraw write fownerdraw; diff --git a/tsdata/param/StockRefDatebyEndt.param b/tsdata/param/StockRefDatebyEndt.param new file mode 100644 index 0000000..ee01737 --- /dev/null +++ b/tsdata/param/StockRefDatebyEndt.param @@ -0,0 +1,16 @@ +【name】StockRefDatebyEndt +【nickname】常见根据指定日推移日期 +【comment】 +【info】股票;行情因子;中间函数 +【typeid】16777217 +【id1】0 +【id2】0 +【id3】0 +【id4】0 +【ctrl】 +【param】 +array( +("paramname":"Endt","paramcomment":"截止日","datatype":3,"value": +("value":44393,"cv":"44393")), +("paramname":"RefType","paramcomment":"推移类型","datatype":17,"value": +("value":"成立以来=12\x0112\x02\x03最近1周=0\x03最近1月=1\x03最近3月=2\x03最近6月=3\x03最近1年=4\x03最近2年=5\x03最近3年=6\x03最近5年=7\x03本周以来=8\x03本月以来=9\x03本季以来=10\x03本年以来=11\x03成立以来=12\x03","cv":"12"))) diff --git a/tsdata/param/StocktTrailingAvgByEndT.param b/tsdata/param/StocktTrailingAvgByEndT.param new file mode 100644 index 0000000..24ec6de --- /dev/null +++ b/tsdata/param/StocktTrailingAvgByEndT.param @@ -0,0 +1,22 @@ +【name】StocktTrailingAvgByEndT +【nickname】获取基于指定日推移阶段的日均指标 +【comment】 +【info】股票;行情因子;中间函数 +【typeid】16777217 +【id1】0 +【id2】0 +【id3】0 +【id4】0 +【ctrl】 +【param】 +array( +("paramname":"Endt","paramcomment":"截止日","datatype":3,"value": +("value":44393,"cv":"44393")), +("paramname":"RefType","paramcomment":"推移类型","datatype":17,"value": +("value":"成立以来=12\x0112\x02\x03最近1周=0\x03最近1月=1\x03最近3月=2\x03最近6月=3\x03最近1年=4\x03最近2年=5\x03最近3年=6\x03最近5年=7\x03本周以来=8\x03本月以来=9\x03本季以来=10\x03本年以来=11\x03成立以来=12\x03","cv":"12")), +("paramname":"Exp","paramcomment":"指标表达式","datatype":16,"value": +("value":"@stockzdf3()","cv":"@stockzdf3()")), +("paramname":"IsExcludeIPO","paramcomment":"是否剔除上市日区间行情","datatype":1,"value": +("value":1,"cv":"1")), +("paramname":"N","paramcomment":"剔除天数","datatype":0,"value": +("value":3,"cv":"3"))) diff --git a/tsdata/param/StocktTrailingStdByEndT.param b/tsdata/param/StocktTrailingStdByEndT.param new file mode 100644 index 0000000..f4bd170 --- /dev/null +++ b/tsdata/param/StocktTrailingStdByEndT.param @@ -0,0 +1,22 @@ +【name】StocktTrailingStdByEndT +【nickname】获取基于指定日推移阶段的指标标准差 +【comment】 +【info】股票;行情因子;中间函数 +【typeid】16777217 +【id1】0 +【id2】0 +【id3】0 +【id4】0 +【ctrl】 +【param】 +array( +("paramname":"Endt","paramcomment":"截止日","datatype":3,"value": +("value":44393,"cv":"44393")), +("paramname":"RefType","paramcomment":"推移类型","datatype":17,"value": +("value":"成立以来=12\x0112\x02\x03最近1周=0\x03最近1月=1\x03最近3月=2\x03最近6月=3\x03最近1年=4\x03最近2年=5\x03最近3年=6\x03最近5年=7\x03本周以来=8\x03本月以来=9\x03本季以来=10\x03本年以来=11\x03成立以来=12\x03","cv":"12")), +("paramname":"Exp","paramcomment":"指标表达式","datatype":16,"value": +("value":"@stockzdf3()","cv":"@stockzdf3()")), +("paramname":"IsExcludeIPO","paramcomment":"是否剔除上市日区间行情","datatype":1,"value": +("value":1,"cv":"1")), +("paramname":"N","paramcomment":"剔除天数","datatype":0,"value": +("value":3,"cv":"3"))) diff --git a/tsdata/鑲$エ/琛屾儏鍥犲瓙/涓棿鍑芥暟/StockRefDatebyEndt.tsf b/tsdata/鑲$エ/琛屾儏鍥犲瓙/涓棿鍑芥暟/StockRefDatebyEndt.tsf new file mode 100644 index 0000000..b317fde --- /dev/null +++ b/tsdata/鑲$エ/琛屾儏鍥犲瓙/涓棿鍑芥暟/StockRefDatebyEndt.tsf @@ -0,0 +1,51 @@ +Function StockRefDatebyEndt(Endt,RefType); +Begin +{** ======================================================================// + %% @explain(说明): + 给出常见的几种根据指定日推移日期,以便于后续提取区间行情 + %% 输入: + %% @param(EndT)(TDateTime) 日期,区间截止日 + %% @param(RefType) 用户自定义,选择所推移类型,取值如下: + 0: 最近1周 + 1: 最近1月 + ... + 12:成立以来,(需要设置系统参数证券代码) + + %% 输出: 值(日期) + %% @remark(更新日志) 2021-07-14 TS业务框架 + +%%//====================================================================== **} + case RefType of + 0: //最近1周 + begt := IncWeek(EndT,-1)+1; + 1: //最近1月 + begt := IncMonth(EndT,-1)+1; + 2: //最近3月 + begt := IncMonth(EndT,-2)+1; + 3: //最近6月 + begt := IncMonth(EndT,-3)+1; + 4: //最近1年 + begt := IncYear(EndT,-1)+1; + 5: //最近2年 + begt := IncYear(EndT,-2)+1; + 6: //最近3年 + begt := IncYear(EndT,-3)+1; + 7: //最近5年 + begt := IncYear(EndT,-5)+1; + 8: //本周以来 + begt := StartOfTheWeek(EndT); + 9: //本月以来 + begt := StartOfTheMonth(EndT); + 10: //本季以来 + begt := StartOfTheQuarter(EndT); + 11: //本年以来 + begt := StartOfTheYear(EndT); + 12: //成立以来,指数:取开始发布日期 + begt := ifthen(stocktype(DefaultStockID())=-1,base(750004),firstday()); + else + begt := endt; + end; + + return begt; + +End; diff --git a/tsdata/鑲$エ/琛屾儏鍥犲瓙/涓棿鍑芥暟/StocktTrailingAvgByEndT.tsf b/tsdata/鑲$エ/琛屾儏鍥犲瓙/涓棿鍑芥暟/StocktTrailingAvgByEndT.tsf new file mode 100644 index 0000000..4c1b227 --- /dev/null +++ b/tsdata/鑲$エ/琛屾儏鍥犲瓙/涓棿鍑芥暟/StocktTrailingAvgByEndT.tsf @@ -0,0 +1,34 @@ +Function StocktTrailingAvgByEndT(Endt,RefType,Exp,IsExcludeIPO,N); +Begin +{** ======================================================================// + %% @explain(说明): + 获取基于指定日推移阶段的日均指标 + %% 输入: + %% @param(EndT)(TDateTime) 日期,区间截止日 + %% @param(RefType) 用户自定义,选择所推移类型,取值如下: + 0: 最近1周 + 1: 最近1月 + ... + 12:成立以来 + %% @param(Exp)(exp) 指标表达式,如@close(),@stockzdf3() + %% @param(IsExcludeIPO)(Bool) 是否剔除上市日区间行情 + %% @param(N)(Int) 剔除天数 + %% 输出: 值(real) + %% @remark(更新日志) 2021-07-14 TS业务框架 + +%%//====================================================================== **} + ov := BackupSystemParameters2(); + if ifnil(IsExcludeIPO) then IsExcludeIPO:=0; + if ifnil(N) then N:=1; + setsysparam(pn_date(),endt); + setsysparam(pn_cycle(),cy_day()); + begt := StockRefDatebyEndt(Endt,RefType); + ND := tradedays(begt,endt); + if IsExcludeIPO then + begin + MD := tradedays(firstday(),sp_time()); + ND := MD-ND<=N?MD-N:ND; + end + return MA(eval(Exp),ND); + +End; diff --git a/tsdata/鑲$エ/琛屾儏鍥犲瓙/涓棿鍑芥暟/StocktTrailingStdByEndT.tsf b/tsdata/鑲$エ/琛屾儏鍥犲瓙/涓棿鍑芥暟/StocktTrailingStdByEndT.tsf new file mode 100644 index 0000000..fc0a469 --- /dev/null +++ b/tsdata/鑲$エ/琛屾儏鍥犲瓙/涓棿鍑芥暟/StocktTrailingStdByEndT.tsf @@ -0,0 +1,34 @@ +Function StocktTrailingStdByEndT(Endt,RefType,Exp,IsExcludeIPO,N); +Begin +{** ======================================================================// + %% @explain(说明): + 获取基于指定日推移阶段的指标标准差 + %% 输入: + %% @param(EndT)(TDateTime) 日期,区间截止日 + %% @param(RefType) 用户自定义,选择所推移类型,取值如下: + 0: 最近1周 + 1: 最近1月 + ... + 12:成立以来 + %% @param(Exp)(exp) 指标表达式,如@close(),@stockzdf3() + %% @param(IsExcludeIPO)(Bool) 是否剔除上市日区间行情 + %% @param(N)(Int) 剔除天数 + %% 输出: 值(real) + %% @remark(更新日志) 2021-07-14 TS业务框架 + +%%//====================================================================== **} + ov := BackupSystemParameters2(); + if ifnil(IsExcludeIPO) then IsExcludeIPO:=0; + if ifnil(N) then N:=1; + setsysparam(pn_date(),endt); + setsysparam(pn_cycle(),cy_day()); + begt := StockRefDatebyEndt(Endt,RefType); + ND := tradedays(begt,endt); + if IsExcludeIPO then + begin + MD := tradedays(firstday(),sp_time()); + ND := MD-ND<=N?MD-N:ND; + end + return sp_Std(eval(Exp),ND); + +End;