Stop loss less than buy price

Could you help me code :

1. Sell when:  Price < Buy Price

2. Sell when:  Price < Low of Buy candle

Thanks

A sell stop market order is a order to sell at the best available price after the price goes below the stop price. A sell stop price is always below the current market price. For example, if an trader holds a stock currently valued at Rs.100 and is worried that the value may drop, he/she can place a sell stop order at Rs.90. If the share price drops to Rs.90, the exchange will sell the order at the next available price. This can limit the traders losses (if the stop price is at or below the purchase price) or lock in some of the profits. To know more about forex tips you can visit MMF Solutions blog about forex trading, target prices and stoploss.

can you reverify your question or brief your question