Hello,
I've recently tried to set a limited number of long and short positions. However, I can't find the correct indentation.
I would like to only place trades in the top 10 longs and top 5 shorts. Please help...
Hello,
I've recently tried to set a limited number of long and short positions. However, I can't find the correct indentation.
I would like to only place trades in the top 10 longs and top 5 shorts. Please help...
hi Dan,
Something like the below might work for you. Where you use ".top" and ".bottom" to differentiate.
go_longs = (base_universe & ROA_long & ROE_long & PE_long & EPS_Growth_long & Current_R_long & debt_to_marketcap_long) | (base_universe & sector & dividentyield_long) #& bullish_intensity
go_shorts = (base_universe & sector & ROA_short & ROE_short & PE_short & EPS_Growth_short & debt_to_marketcap_short & Current_R_short ) | ( dividentyield_short & sector & base_universe)
longs = go_longs.top(10)
shorts = go_shorts.bottom(5)
picks = longs | shorts