Hi all,
I'm learning Python and Quantopian everyday. Thank you all.
Question:
order_target_percent(sid, target_percent, limit_price=value1, stop_price=value2)
1). O.K. now I want to send limit order as I want to enter at specific price. Since Quantopian uses 1-minute price data, I believe that all the orders (limit or market) also should be based on the 1-min. data. What if my limit order does not match any price (1-min. close price) that Quantopian received from its data source?
For example, I want to buy AAPL at 500.50. AAPL price is 500.45 at 10:00:00 (close price at 10:00:00) and 500.55 at 10:01:00. Then is my limit order at 500.50 going to get filled? or not? (I know if my order was stop then it will get filled).
Sometimes, this is a critical issue. Especially when the market moves so fast and I thought that my orders got filled, but in reality, it's not filled and my stock went up too high (for long). I am missing a huge momentum.
(In other platform, I know that some use tick price data).
In real market, my limit order in the above example should get filled.
2). Is there any warning message window or any tools other than logs that show whether my orders get filled at specific price at the moment or not? Or I just should go with Stop order?
3). How about Market order?
For example, my orders are all market orders as most people here in Quantopian use. If AAPL is 500.50 at 10:00:00 and my model sent a market order to buy at 10:00:00, is my order going to get filled at 500.50? In real market, as we all know, there are bid and ask prices. If AAPL price at 10:00:00 was 500.50, it does NOT mean that ask price (because my order is a buying order with market order) is equal to 500.50. I believe that ask price is a little bit more than 500.50 due to the spread between the bid and ask. Then I assume that my market order to buy at 10:00:00 should get filled at a little higher than 500.50 in real market.
This discrepancy will affect the PnL with a real money trading because the back-testing results will NOT be close to the ones with real market. I'm just curious how Quantopian system works in terms of orders. (No criticism, No offense).
4). For reference, how fast are all the orders going to be placed? I know this system is not for HFT but I'm just curious. I believe that Python is fast enough compared to other scripting languages (except C/C++).
Thank you.