Hi,
I'm trying to run a very simple BTCUSD algorithm with QuantConnect Paper Trading.
The algorithm receives fresh BTCUSD minute data correctly, but a Market Order remains indefinitely in Submitted status and is never filled.
Configuration:
- QuantConnect Paper Trading
- L-MICRO live node
- NY7
- QuantConnect data provider
- BTCUSD / Coinbase
- Minute resolution
- USD cash account
Example from the live log:
FRESH BTC DATA | Price=77267.04
Immediately after receiving that fresh data:
SENDING MARKET BUY | Qty=0.001
The resulting order event is:
Status=Submitted | Qty=0 | Fill=0.00
The order remains Submitted in the Orders tab with $0.00 fill.
I also tested both BrokerageName.QuantConnectBrokerage and BrokerageName.Coinbase, with the same result.
Minimal reproduction:
using QuantConnect;
using QuantConnect.Algorithm;
using QuantConnect.Brokerages;
using QuantConnect.Data;
using QuantConnect.Data.Market;
using QuantConnect.Orders;
public class BtcPaperFillTest : QCAlgorithm
{
private Symbol _btc;
private bool _sent;
public override void Initialize()
{
SetCash(10000);
SetBrokerageModel(
BrokerageName.QuantConnectBrokerage,
AccountType.Cash
);
_btc = AddCrypto(
"BTCUSD",
Resolution.Minute,
Market.Coinbase
).Symbol;
}
public override void OnData(Slice data)
{
if (_sent || !data.Bars.ContainsKey(_btc))
return;
var price = Securities[_btc].Price;
if (price <= 0)
return;
Log($"FRESH BTC DATA | Price={price:F2}");
MarketOrder(
_btc,
0.001m,
tag: "PAPER FILL TEST"
);
_sent = true;
}
public override void OnOrderEvent(OrderEvent orderEvent)
{
Log(
$"ORDER EVENT | " +
$"Status={orderEvent.Status} | " +
$"Qty={orderEvent.FillQuantity} | " +
$"Fill={orderEvent.FillPrice:F2} | " +
$"Message={orderEvent.Message}"
);
}
}
Since BTCUSD trades 24/7 and the algorithm is receiving fresh data immediately before submitting the order, I expected the Paper Trading market order to fill immediately.
Is there anything missing from this configuration, or is there currently an issue with BTCUSD fills in QuantConnect Paper Trading?
Thanks.
Eric S.
The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
To unlock posting to the community forums please complete at least 30% of Boot Camp.
You can continue your Boot Camp training progress from the terminal. We hope to see you in the community soon!