Still learning the ropes.

What I'm trying to achieve is to buy an equity whenever current price is 10% higher than the opening price of the day, then sell it at end day. To clarify, at anytime during the normal trading hours, if an equity's price reaches more than 10% of the opening price, there should be a market order placed.

Below shows the starting few lines of the logs. As seen, only one order is made. And instead of selling, it would appear I am buying stocks at end day.

2022-01-03 09:32:00 : 	[2022-01-03 09:32:00] STER XS22WUTNTYSL: openPrice: 20.6 buyingPrice: 22.99
2022-01-03 15:50:00 : 	End day. Liquidating!
2022-01-03 15:50:00 : 	Count: 1
2022-01-03 15:50:00 : 	[2022-01-03 15:50:00] AFIB XGSEQC44B4O5: openPrice: 3.49 buyingPrice: 3.91
2022-01-03 15:50:00 : 	[2022-01-03 15:50:00] LIVK XB6K364IMGRP: openPrice: 4.8 buyingPrice: 5.29