Let's break down the condition you have here.
if(RealizedPnL <= -900)
This would read out as if RealizedPnL is less than or equal to -900 then place trades
However, less than -900 is -901, -902 and so on.
You want this to have if(RealizedPnL >= -900) then place trades.
Comment