Hello, I am brand new user to QuantConnect! I would like to backtest the following basic idea for a particular stock. Here is the pseduocode starting with an initial cash of $1,000:

Buy Conidition: If $1,000 cash available and price drops 5% within the last 7 days, buy $1,000 of XYZ

Sell Condition: If price rises 10% since last buy order, sell all XYZ holdings

Is this possible to backtest in QuantConnect? The caveat is that this algorithm would not buy more than once in a row without selling. Also, another important distinction is that the buy condition is irrsepective of ticker price. Let me know if that makes sense!

Author