I'm afraid, you have to take a deeper dive into some basics before coding Limit strategies.
What Is a Limit Order?
A limit order is a type of order to purchase or sell an instrument at a specified price or better.
BUY LIMIT orders will only be executed at the limit price or lower. [in your example: 0 or lower, now 2 or lower, challenging, which instrument do you want to buy at this price point?]
SELL LIMIT orders, the order will be executed only at the limit price or a higher one. [in your example: 0 or higher, easy, never a show stopper for short].
I hope this clarifies.
NT-Roland
Comment