Hi,
My trading strategy involves staying long when share price is higher than 20D MA, immediately sell at market intraday when share price drops below 20D MA, but buy back again if share price moves back higher than 20D MA. The 20D MA is calculated daily before market opens, using the close prices for the past 20 sessions, and will stay as one value throughout the day. I have some good back-testing results for momentum stocks. I know nothing about API - but I am utilizing the parent/child + conditional orders in IB. I would be most grateful if anyone can point out whether there is a smarter way to achieve the same strategy, or if this simply won't work:
- Say I already owned 100 shares of TSLA, and before market opens today, I calculated the 20D MA to be $335
- Stock opens at $337
- In IB, my parent order (1.0) is to sell 100 shares at market via IEX with a conditional trigger when share price drops below $335. I didn't use Stop order as it may not work well if the stock gaps down a lot at open. I didn't use market sell via SMART as the slippage seems large. I didn't use adaptive or other algos as they are not allowed in conditional parent-child orders
- A child order (1.1) is created, and will be triggered only if 1.0 is completed. This is to buy at market via IEX if share price > $335
- A sub-child order (1.2) is added, and will be triggered only if 1.1 is completed. This is to sell at market via IEX if share price < $335
- A series of orders is repeated this way
My worry is that the orders will all be executed very quickly if the share price bounds within a narrow range. I was hoping to add a 5-min waiting time between orders but seems cannot be done in IB.
Any comments are welcome. Thanks!
My trading strategy involves staying long when share price is higher than 20D MA, immediately sell at market intraday when share price drops below 20D MA, but buy back again if share price moves back higher than 20D MA. The 20D MA is calculated daily before market opens, using the close prices for the past 20 sessions, and will stay as one value throughout the day. I have some good back-testing results for momentum stocks. I know nothing about API - but I am utilizing the parent/child + conditional orders in IB. I would be most grateful if anyone can point out whether there is a smarter way to achieve the same strategy, or if this simply won't work:
- Say I already owned 100 shares of TSLA, and before market opens today, I calculated the 20D MA to be $335
- Stock opens at $337
- In IB, my parent order (1.0) is to sell 100 shares at market via IEX with a conditional trigger when share price drops below $335. I didn't use Stop order as it may not work well if the stock gaps down a lot at open. I didn't use market sell via SMART as the slippage seems large. I didn't use adaptive or other algos as they are not allowed in conditional parent-child orders
- A child order (1.1) is created, and will be triggered only if 1.0 is completed. This is to buy at market via IEX if share price > $335
- A sub-child order (1.2) is added, and will be triggered only if 1.1 is completed. This is to sell at market via IEX if share price < $335
- A series of orders is repeated this way
My worry is that the orders will all be executed very quickly if the share price bounds within a narrow range. I was hoping to add a 5-min waiting time between orders but seems cannot be done in IB.
Any comments are welcome. Thanks!