Skip to content

Commit c46fd9c

Browse files
committed
Update intervals
1 parent 87d617a commit c46fd9c

3 files changed

Lines changed: 8 additions & 106 deletions

File tree

code/common/backtest.q

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
\d .backtest
22

33
/ Params to be passed to .backtest.run to kick off backtest, edit to fit usecase
4-
test:`name`version`tabs`sts`ets`datainterval`timer`timerinterval`timerfunc!(`;1;`;0Np;0Np;0Nn;0b;0Nn;`);
4+
test:`name`version`tabs`sts`ets`replayinterval`timer`timerinterval`timerfunc!(`;1;`;0Np;0Np;0Nn;0b;0Nn;`);
55
initRan:0b;
66

77
/ TO BE DELETED, TESTING ONLY
8-
test:`name`version`tabs`sts`ets`datainterval`timer`timerinterval`timerfunc!(`vwappublisher;1;`trade;2026.01.22D00:00:00.00;2026.01.22D01:00:00.00;0Nn;1b;0D00:10:00.00;`.vwapsub.logvwap);
8+
test:`name`version`tabs`sts`ets`replayinterval`timer`timerinterval`timerfunc!(`vwappublisher;1;`trade;2026.01.22D00:00:00.00;2026.01.22D01:00:00.00;0Nn;1b;0D00:10:00.00;`.vwapsub.logvwap);
99

1010
init:{[]
1111
requiredProcs:`backtestdb`backtestpub;
@@ -43,7 +43,7 @@ validaterun:{[params]
4343
if[.proc.procname=`backtestpub;'"Backtest should be ran from the process you are backtesting not backtest instance itself"];
4444
if[not initRan;'"Please run .backtest.init to override functions to backtest before running .backtest.run";];
4545
if[not all (key[test]except `where) in key params;'"Please ensure all mandatory params have been populated";];
46-
if[count where null `datainterval _params;'"Not all mandatory keys have been populated"];
46+
if[count where null `replayinterval _params;'"Not all mandatory keys have been populated"];
4747
/ Remove optional where, when not required
4848
if[`where in key params; if[not count params`where;params:`where _params]];
4949
params

code/common/datareplay.q

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ getBuckets:{[s;e;p](s+p*til(ceiling 1+e%p)-(ceiling s%p))}
66
// params[`t] is table data
77
// params[`tc] is time column to cut on
88
// params[`tn] is table name
9-
// params[`timerinterval] is the timer time interval to bucket the messages into.
10-
// params[`datainterval] is the data time interval to bucket the messages into.
9+
// params[`replayinterval] is the data time interval to bucket the messages into.
1110
tableDataToDataStream:{[params]
1211
.dbg.params:params;
1312
// Sort table by time column.
@@ -16,10 +15,10 @@ tableDataToDataStream:{[params]
1615
// get all times from table
1716
t_times:params[`t][params[`tc]];
1817

19-
$[not null params[`datainterval];
18+
$[not null params[`replayinterval];
2019
[ // if there is an interval, bucket messages into this interval
2120
// make buckets of ten second intervals
22-
times:getBuckets[params[`sts];params[`ets];params[`datainterval]];
21+
times:getBuckets[params[`sts];params[`ets];params[`replayinterval]];
2322

2423
// put start time in fornt of t_times
2524
t_times:params[`sts],t_times;
@@ -79,7 +78,7 @@ tableToDataStream:{[params]
7978
// params[`tp] is the increment between times
8079
// params[`timerfunc] is the timer function to use
8180
getTimers:{[params]
82-
times:getBuckets[params[`sts];params[`ets];params[`replayinterval]];
81+
times:getBuckets[params[`sts];params[`ets];params[`timerinterval]];
8382
([]time:times;msg:params[`timerfunc],'times)
8483
}
8584

@@ -92,11 +91,10 @@ getTimers:{[params]
9291
// params[`timer] is whether or not to retrieve timer - Default 0b
9392
// params[`h] is handle to hdb - Default 0 (self)
9493
// params[`timerinterval] is the time interval to bucket the timer messages into. - Not Required
95-
// params[`datainterval] is the time interval to bucket the upd messages into. - Not Required
9694
// prarms[`tc] is the time column of the tables specified - Defualt `time
9795
// params[`timerfunc] is the timer function to use in timer messages - Default `.z.ts
9896
tablesToDataStream:{[params]
99-
defaults:`timer`h`syms`datainterval`replayinterval`tc`timerfunc`where!(0b;0;`symbol$();`timespan$0n;`timespan$0n;`time;`.z.ts;());
97+
defaults:`timer`h`syms`replayinterval`timerinterval`tc`timerfunc`where!(0b;0;`symbol$();`timespan$0n;`timespan$0n;`time;`.z.ts;());
10098
params:defaults,params;
10199

102100
// check for default parameters `tabs`sts`ets

code/processes/vwapsub.q

Lines changed: 0 additions & 96 deletions
This file was deleted.

0 commit comments

Comments
 (0)