How to manage orders

Discussion in 'Automated Trading' started by xappppp, May 20, 2020.

  1. xappppp

    xappppp

    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
     
  2. 2rosy

    2rosy

    1. keep track of bid/offers and size
    2. keep track of positions
    3. keep track of open orders, submitted orders
    4. listen to your signals
    do not "right" a lot of if else condition unless you want a mess
     
  3. xappppp

    xappppp

    Thanks for the advise. If I have a position that I want to close it whenever the price is above or below a threshold, is there any specific way to set up the order so the execution will be robust and easy to understand. I’m thinking of some if else condition and then set up orders, but I can guess there will be a lot if potential problems. I’m wondering usually how usually the code is design exiting a position.


     
  4. easymon1

    easymon1

  5. camera

    camera

    Agree with this. A good advice tho
     
  6. I might be wrong but this is what I am thinking. You monitor the bid/ ask price. When ask/bid price is at the level that you want you fire a market order.
    Let me know if i am missing something.
     
  7. xappppp

    xappppp

    Yes, this is what I want (either a market order or limit order I think), my exact question is how usually this is implemented or code up, do I just do following:

    if price>xxxx or price<xxxx then sell at market order

    Is there going to be any problem if doing this way?
     
  8. xappppp

    xappppp

    Kernel007 likes this.