We study the existence of a minimal supersolution for backward stochastic differential equations when the terminal data can take the value 916000417&_mathId=si1.gif&_user=111111111&_pii=S0304414916000417&_rdoc=1&_issn=03044149&md5=7e4b73906c578d8aa2d53b3cca5c4968" title="Click to view the MathML source">+∞ with positive probability. We deal with equations on a general filtered probability space and with generators satisfying a general monotonicity assumption. With this minimal supersolution we then solve an optimal stochastic control problem related to portfolio liquidation problems. We generalize the existing results in three directions: firstly there is no assumption on the underlying filtration (except completeness and quasi-left continuity), secondly we relax the terminal liquidation constraint and finally the time horizon can be random.