Hello !

I would know if I am right to do the following code to check if the portfolio is invested in a certain security :

if (algorithm.Portfolio.Securities.ContainsKey("EURUSD")) { if (!algorithm.Portfolio.Invested) { Base.EURUSD_OCO1_UP_IsReady = true; } }

Thanks !

Author