Really struggling to wrap my head around this because I keep running into the same issue as I’m trying to code up strategies…so Quantrocket ignores the fact of whether a position is already held or not? But isn’t that ignoring a fundamental part of stock trading which is profit and return depends on both the entry and the exit?
For example, if I want to enter a position when the RSI drops below 35 and sell the position when the RSI rises above 70, I can’t do that with Quantrocket because my price_to_signal result (0 - sell, or 1- buy) can receive no information as to whether my initial state for that position is currently being held or not (0 - not held, or 1 - held) every time the algorithm runs.
I was trying to get around this by creating ‘sell_signals’ and ‘buy_signals’ dataframes and subtracting them or doing some XOR logic, but neither worked…both subtracting them or XOR’ing them requires knowing whether the security is currently held or not. That information needs to be passed no matter how you skin the cat.
Perhaps I’m not thinking of this correctly, but I’m pulling my hair out here after spending 8 hours coding a strategy and hitting this brick wall on two separate occasions: Quantrocket purely derives buy, sell, and short signals solely from market pricing, not from market pricing relative to portfolio positions?