I have a live algorithm running where I am exclusively placing Limit orders. For some of those orders, I am getting hit with a fee from GDAX, while for others I am not, although my dashboard says they were all submitted as Limit orders. I thought there was no fee associated with GDAX limit orders. Is there something I am missing here?
Ahmad Emad
I dug around and found that I could do this in C#:
DefaultOrderProperties = new GDAXOrderProperties { PostOnly = true };
Is there a Python equivalent to this?
Derek Tishler
"I thought there was no fee associated with GDAX limit orders" (sans PostOnly flag I just wanted to clarify):
Does every limit order count as a market maker? I think that depends on the state of the current order book, better described here:
But...it does seems every GDAX limit order in QC is being marked automatically as PostOnly to attempt and achieve a Maker-Only order as GDAX provides:
I am unsure why fees still appear in our case. One quick fix may be to use a constant fee model, though I am unsure if that is more or less realistic:
self.Securities["BTCUSD"].FeeModel = ConstantFeeTransactionModel(0.0)
Haumed Rahmani
According to their syntax it should be like this for Python:
DefaultOrderProperties = GDAXOrderProperties() DefaultOrderProperties.PostType = True
Although I've tried it and it made no difference in my algorithm that repeatedly buys and sells using limit orders. There's no fee either way.
Supposedly the fee model for GDAX is 0.1% for market orders and 0% for anything else (limit, stop) so that should mean that enabling PostType is useless.
Possibly you're pulling margin?
Stefano Raggi
Just to clarify, the GDAX Post-Only option only has effect on limit orders submitted to the live GDAX brokerage: it has no effect in backtesting and when using the live Paper brokerage (in these cases the fee for limit orders will always be zero).
When setting the PostOnly option to true with live GDAX, a limit order that would have been executed as a liquidity taker (paying the taker fees) will be rejected and the algorithm will have to re-submit it.
The default value of PostOnly is false, so if we do not want to risk paying any fees on limit orders, we need to set it to true.
Catherine Stahl
It did make a difference for me in live mode. However, as indicated above, GDAX will reject some limit orders that were sent as post only.
In backtest mode, it makes no difference.
Ahmad Emad
Thanks everybody. I was able to avoid any fees once I did:
DefaultOrderProperties = GDAXOrderProperties() DefaultOrderProperties.PostType = True
Stefano Raggi
@Ahmad, glad you solved the issue, although the second line should be:
DefaultOrderProperties.PostOnly = True
Catherine Stahl
Yeah
Haumed Rahmani
Yeah sorry stupid typo ha. But yes so @Stefano, that means that fee-wise there's no point in doing Post Only? It'll be 0% either way as long as it's Limit? I've only been able to try backtesting so far, haven't made it to live.
Stefano Raggi
Haumed Rahmani Correct, in both backtesting and live Paper brokerage the Post Only flag is not used and limit order will always have zero fees.
Haumed Rahmani
Guys I've figured it out, none of the above code will work during live trading. Must be
self.DefaultOrderProperties = GDAXOrderProperties() self.DefaultOrderProperties.PostOnly = True
(DefaultOrderProperties is located in self.)
Note: this will fail instead of paying a fee, so you may have to try again. It'll give an error like the following:
New Order Event: Time: 12/29/2017 1:54:58 AM OrderID: 1 Symbol: ETHUSD Status: Invalid Message: Reject reason: post only
The cleanest approach would be to attach an event handler that tries again on fail.
Brad Carter
Is there a way to have the trading fee be active during backtesting, similar to what it would be during live trading? Reading through everything I can find I think the fee is 0.1% and would apply to all trades using the default SetHoldings method, correct?
Ahmad Emad
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!