INNER CODE UNIT · Python

b_a_w

dmarienko/QuantTradingResearch · models/helpers.py:141

    b_a_w = kfm.model.b.div(kfm.model.b.sum(axis=1), axis=0)
    
    signals = pd.concat((
         -b_a_w[longs],  b_a_w[longs_exits] * 0, 
          b_a_w[shorts], b_a_w[shorts_exits] * 0,
    ), axis=0).sort_index()

    # take opposite position on Index
    signals['^RUI'] = 0
    signals.loc[longs, '^RUI'] = +1
    signals.loc[shorts, '^RUI'] = -1
    
    # we will trade 1000 shares per stock and execute on daily close
    signals = shift_signals(np.floor(traded_size * signals), hours=15, minutes=59)
    return signals.astype(int)
    

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…