I am trying to figure out how to write code for Algo, which will: 

Create before MKT Open 3 Orders every day (Time in Force: DAY): 

1. Buy 100 of SPY on MKT Open (Order Type: MKT)


2. Sell 100 of SPY if the price falls by 1% 

  • OR Sell 100 of SPY on MKT Close (Order Type: MKT)

Thank You