Im looking for some existing ways in a automated system how usually and order is generated being tracked and once a position is filled, how it is being monitored for exiting. Just start to explore this aspects, so any thoughts or reference is appreciated. So far it seems to me I need to right a lot of if else condition to read market price/make and cancel order in order to buy a stock and watch if I need to sell for profit or sell stop loss. Now Im just looking for some leads to think in the right direction