Hello All,

I'm wiriting an algoritm that will trade an ETF that has reletivly low volume.

That means that there is a high risk of mid day gaps

I have found an example of using Limit Orders to buy stocks below a certian price, and I'm trying

to understand how it works:

 

// Purchase 10 SPY shares when its 1% below the current price var close = Securities["SPY"].Close; var limitTicket = LimitOrder("SPY", 10, close * .99m);Will the LimitOrder buy a stock only if it is under a certian price (1% lower than the close price?)or will it "Trigger" a Purchase at any price once the price is 1% lower than the close price?How can I make sure that the algoritm does not Purchase stocks at the "wrong" price becase of a mid-day gap that occuresafter a purchase order is triggerd?Thank you!

Author