Trading normally produces the same results as testing. So check first if the not placed orders are maybe just a normal behavior of the script. Otherwise use printf statements for checking why and when the trade conditions in your script are not fulfilled.