def forward(self, close_ts, volume_ts): ts = tsf.rolling_corr(close_ts, volume_ts, 2) return -1 * (tsf.rank(tsf.rolling_mean_(tsf.shift(close_ts, 5), 20)) * ts * tsf.rank( tsf.rolling_corr(tsf.rolling_sum_(close_ts, 5), tsf.rolling_sum_(close_ts, 20), 2)) ) # .values
def forward(self, vwap_ts, low_ts, volume_ts): output_tensor = ( tsf.rank(tsf.rolling_corr(vwap_ts, volume_ts, 4)) * tsf.rank( tsf.rolling_corr(tsf.rank(low_ts), tsf.rank(tsf.rolling_mean_(volume_ts, 50)), 12))) return output_tensor
def forward(self, high_ts, low_ts, close_ts, volume_ts): divisor = (tsf.rolling_max(high_ts, 12) - tsf.rolling_min(low_ts, 12)).replace(0, 0.0001) inner = (close_ts - tsf.ts_min(low_ts, 12)) / (divisor) ts = tsf.rolling_corr(tsf.rank(inner), tsf.rank(volume_ts), 6) output_tensor = -1 * ts return output_tensor
def forward(self, high_ts, close_ts, volume_ts, vwap_ts): output_tensor = ((((tsf.rank( (1 / close_ts)) * volume_ts) / tsf.rolling_mean_(volume_ts, 20)) * ((high_ts * tsf.rank((high_ts - close_ts))) / (tsf.rolling_sum_(high_ts, 5) / 5))) - tsf.rank( (vwap_ts - tsf.shift(vwap_ts, 5)))) return output_tensor
def forward(self, high_ts, low_ts, close_ts, volume_ts): output_tensor = tsf.rolling_corr( tsf.rank(( (close_ts - tsf.rolling_min(low_ts, 12)) / (tsf.rolling_max(high_ts, 12) - tsf.rolling_min(low_ts, 12)))), tsf.rank(volume_ts), 6) return output_tensor
def forward(self, close_ts, volume_ts): output_tensor = (-1 * ( (tsf.rank((tsf.rolling_sum_(tsf.shift(close_ts, 5), 20) / 20)) * tsf.rolling_corr(close_ts, volume_ts, 2)) * tsf.rank( tsf.rolling_corr(tsf.rolling_sum_(close_ts, 5), tsf.rolling_sum_(close_ts, 20), 2)))) return output_tensor
def forward(self, volume_ts, close_ts): output_tensor = ( ((-1 * tsf.rank(tsf.ts_rank(close_ts, 10))) * tsf.rank(tsf.diff(tsf.diff(close_ts, 1), 1))) * tsf.rank( tsf.ts_rank( (volume_ts / tsf.rolling_mean_(volume_ts, 20)), 5))) return output_tensor
def forward(self, close_ts, open_ts, vwap_ts, volume_ts): output_tensor = ( tsf.rank(tsf.diff( ((close_ts * 0.6 + open_ts * 0.4)), 1)) * tsf.rank( tsf.rolling_corr(vwap_ts, tsf.rolling_mean_( volume_ts, 150), 15))) return output_tensor
def forward(self, high_ts, low_ts, close_ts, volume_ts): output_tensor = (tsf.rank( tsf.rolling_corr( ((high_ts * 0.9) + (close_ts * 0.1)), tsf.rolling_mean_(volume_ts, 30), 10))**tsf.rank( tsf.rolling_corr(tsf.ts_rank(((high_ts + low_ts) / 2), 4), tsf.ts_rank(volume_ts, 10), 7))) return output_tensor
def forward(self, high_ts, low_ts, volume_ts, vwap_ts, close_ts): output_tensor = ((tsf.rank( tsf.shift(((high_ts - low_ts) / (tsf.rolling_sum_(close_ts, 5) / 5)), 2)) * tsf.rank(tsf.rank(volume_ts))) / (((high_ts - low_ts) / (tsf.rolling_sum_(close_ts, 5) / 5)) / (vwap_ts - close_ts))) return output_tensor
def forward(self, vwap_ts, volume_ts, low_ts): output_tensor = (tsf.rank( tsf.rolling_corr( tsf.rolling_sum_(((low_ts * 0.35) + (vwap_ts * 0.65)), 20), tsf.rolling_sum_(tsf.rolling_mean_(volume_ts, 40), 20), 7)) + tsf.rank( tsf.rolling_corr(tsf.rank(vwap_ts), tsf.rank(volume_ts), 6))) return output_tensor
def forward(self, close_ts, returns_ts): return tsf.rolling_min( tsf.rank( tsf.rank( tsf.rolling_scale( torch.log( tsf.rolling_sum_( tsf.rank( tsf.rank(-1 * tsf.rank( tsf.diff((close_ts - 1), 5)))), 2))))), 5) + tsf.ts_rank(tsf.shift((-1 * returns_ts), 6), 5)
def forward(self, volume_ts, vwap_ts): output_tensor = ((tsf.rank( (vwap_ts - tsf.rolling_min(vwap_ts, 12)))**tsf.ts_rank( tsf.rolling_corr( tsf.ts_rank(vwap_ts, 20), tsf.ts_rank(tsf.rolling_mean_(volume_ts, 60), 2), 18), 3)) * -1) return output_tensor
def forward(self, close_ts, volume_ts): output_tensor = (-1 * ((tsf.rank( ((torch.sign((close_ts - tsf.shift(close_ts, 1))) + torch.sign( (tsf.shift(close_ts, 1) - tsf.shift(close_ts, 2)))) + torch.sign((tsf.shift(close_ts, 2) - tsf.shift(close_ts, 3)))))) * tsf.rolling_sum_(volume_ts, 5)) / tsf.rolling_sum_(volume_ts, 20)) return output_tensor
def forward(self, close_ts, returns_ts): zeros = torch.zeros(returns_ts.size()) downside_stds = tsf.rolling_downside_std(returns_ts, zeros, 20) inner = close_ts.clone() cond = returns_ts < 0 inner = torch.where(cond, downside_stds, inner) output_tensor = tsf.rank(tsf.ts_argmax(inner**2, 5)) return output_tensor
def forward(self, close_ts, volume_ts): delta_close = tsf.diff(close_ts, 1) inner = torch.sign(delta_close) + torch.sign(tsf.shift( delta_close, 1)) + torch.sign(tsf.shift(delta_close, 2)) alpha = ( (1.0 - tsf.rank(inner)) * tsf.rolling_sum_(volume_ts, 5)) / tsf.rolling_sum_(volume_ts, 20) return alpha
def forward(self, low_ts, return_ts, volume_ts): output_tensor = (( ((-1 * tsf.rolling_min(low_ts, 5)) + tsf.shift(tsf.rolling_min(low_ts, 5), 5)) * tsf.rank( ((tsf.rolling_sum_(return_ts, 240) - tsf.rolling_sum_(return_ts, 20)) / 220))) * tsf.rolling_min(volume_ts, 5)) return output_tensor
def forward(self, open_ts, returns_ts): output_tensor = -1 * (tsf.rank( ((tsf.rolling_sum_(open_ts, 5) * tsf.rolling_sum_(returns_ts, 5)) - tsf.shift((tsf.rolling_sum_(open_ts, 5) * tsf.rolling_sum_(returns_ts, 5)), 10)))) return output_tensor
def forward(self, open_ts, high_ts, low_ts, close_ts): alpha = -1 * (tsf.rank(open_ts - tsf.shift(high_ts, 1)) * tsf.rank(open_ts - tsf.shift(close_ts, 1)) * tsf.rank(open_ts - tsf.shift(high_ts, 1))) return alpha
def forward(self, low_ts, volume_ts, returns_ts): return ((-1 * tsf.diff(tsf.rolling_min(low_ts, 5), 5)) * tsf.rank( ((tsf.rolling_sum_(returns_ts, 60) - tsf.rolling_sum_( returns_ts, 20)) / 55))) * tsf.ts_rank(volume_ts, 5)
def forward(self, open_ts, close_ts, volume_ts): # volume output_tensor = -1 * tsf.rolling_corr( tsf.rank(tsf.diff(torch.log(volume_ts), 2)), tsf.rank((close_ts - open_ts) / open_ts), 6) return output_tensor
def forward(self, high_ts, volume_ts): output_tensor = tsf.rolling_corr(high_ts, tsf.rank(volume_ts), 5) return -1 * output_tensor
def forward(self, low_ts): alpha = -1 * tsf.ts_rank(tsf.rank(low_ts), 9) return alpha
def forward(self, high_ts, volume_ts): alpha = -1 * tsf.rank(tsf.rolling_std(high_ts, 10)) * tsf.rolling_corr( high_ts, volume_ts, 10) return alpha #
def forward(self, open_ts, close_ts): inner = close_ts / open_ts alpha = -1 * tsf.rank(tsf.ts_rank(open_ts, 10)) * tsf.rank(inner) return alpha
def forward(self, open_ts, close_ts): alpha = tsf.rank( tsf.rolling_corr(tsf.shift(open_ts - close_ts, 1), close_ts, 200)) + tsf.rank(open_ts - close_ts) return alpha
def forward(self, close_ts, returns_ts): inner = tsf.rolling_std(returns_ts, 2) / tsf.rolling_std(returns_ts, 5) return tsf.rank(2 - tsf.rank(inner) - tsf.rank(tsf.diff(close_ts, 1))) # .values
def forward(self, open_ts, close_ts): alpha = tsf.rank(-1 + (open_ts / close_ts)) return alpha
def forward(self, open_ts, volume_ts): output_tensor = -1 * tsf.rolling_corr(tsf.rank(open_ts), tsf.rank(volume_ts), 10) return output_tensor
def forward(self, high_ts, close_ts, volume_ts): ts = tsf.rolling_cov(high_ts, volume_ts, 5) alpha = -1 * tsf.diff(ts, 5) * tsf.rank(tsf.rolling_std(close_ts, 20)) return alpha