parent
e9f7ae4e50
commit
2768380032
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -58,14 +58,29 @@ type tcustompagecontrol = class(TCustomControl)
|
|||
FTabRects;
|
||||
FClientarea;
|
||||
private
|
||||
function gettabsheetitem(idx);
|
||||
begin
|
||||
if idx>=0 and idx<ftabitems.length() then return FTabItems[idx];
|
||||
if isacceptsheettype(idx) then
|
||||
begin
|
||||
for i:= 0 to ftabitems.length()-1 do
|
||||
begin
|
||||
it := FTabItems[i];
|
||||
if idx=it.PageSheet then return it;
|
||||
end
|
||||
end
|
||||
end
|
||||
function gettabesheet(idx);
|
||||
begin
|
||||
if idx>=0 then return FTabItems[idx];
|
||||
if idx>=0 and idx<ftabitems.length() then
|
||||
begin
|
||||
return FTabItems[idx].PageSheet;
|
||||
end
|
||||
end
|
||||
function getactivetabsheet();
|
||||
begin
|
||||
id := FCurrentid;
|
||||
if id>=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,10 +646,9 @@ 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
|
||||
begin
|
||||
pg := FTabItems[i].PageSheet;
|
||||
if not pg then continue;
|
||||
pg.Align := alNone;
|
||||
if i=FCurrentid then
|
||||
begin
|
||||
pg.Visible := true;
|
||||
|
|
@ -643,6 +663,7 @@ type tcustompagecontrol = class(TCustomControl)
|
|||
end
|
||||
pg.SetBoundsrect(rc);
|
||||
end else
|
||||
begin
|
||||
pg.Visible := false;
|
||||
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;
|
||||
|
|
|
|||
|
|
@ -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")))
|
||||
|
|
@ -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")))
|
||||
|
|
@ -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")))
|
||||
|
|
@ -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;
|
||||
|
|
@ -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;
|
||||
|
|
@ -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;
|
||||
Loading…
Reference in New Issue