Hi all,

i have recently spent some time on an algo which trades 0DTE options (sells them). Some conditions related to min implied volatility and a stop loss/liquidate before end of day features are implemented. 

I used some code i found here in another topic, so thanks to the OP of that discussion. 

I am trying to run it live but QC rejects it as it uses more ram than my node has (500mb). I know it has to store some option chains, but is there any way to reduce the ram usage? 

For example, i may force it to get less strikes in the option chain, but when i try to do so it results in an error due to missing data. Is that because i subscribe to an option contract but then when spot price moves the algo “unsubscribes” from the same option contract?

Moreover any coding tip or improvement is welcome here. Please note that this strategy by design doesn't trade in 2023 (too low vol to justify the risk).