Hi,
i have a working algo and i know have to use the C# method but I'm a little confused about the brokerage.
I have this is my algo:
SetBrokerageModel(Brokerages.BrokerageName.GDAX, AccountType.Cash);
I guess GDAX is now coinbase pro and i have an account but I don't see any option to fund it with USD, am i supposed to fund the account with USDT or how does that work?
I.E. what is this "your brokerage cash"
Setting CashIn backtests you can set your starting capital using the SetCash(decimal cash)
method. In live trading this is ignored and your brokerage cash is used instead. In paper trading we set the cash to a fictional $100,000 USD.
Shile Wen
Hi Dean,
The Brokerage cash is whatever currencies or cryptos held in the brokerage account, which means if you have Bitcoins you could potentially buy Ethereum with it. To use SetCash with non-USD, we need to overload SetCash and use SetCash(crypto, units), e.g. SetCash('BTC', 10). Please see this thread for more details. Furthermore, AccountType.Cash indicates that the account is a cash account, which means margin is not available.
Best,
Shile Wen
Dean Kuntz
Thank you Shile!
That was super helpful. What i want to be sure of is can i trade live just like backtesting but i'm going to use coinbase pro (GDAX) and in my algo i always use.
private int _startingCash = 100;
SetCash(_startingCash);
now if i change it to
SetCash("BTC",0.001);
Will it work in live trade? I am Canadian and coinbase pro will not let me trade any XXX-USD pairs but it will allow XXX-USDC and everything else. So if just dump some BTC in my account 0.0001 will the algo just work in live trading as it does in backtesting or am i missing something?
I'm just a couple days into learning QC.
Thanks,
Dean
Shile Wen
Hi Dean,
The SetCash method is ignored in live trading, and all the cash positions will be loaded from the brokerage account data.
Best,
Shile Wen
Dean Kuntz
I know, but, i'm asking if you know if this example will work:
If i send BTC to coinbase and then run my algo in live trading will "the brokerage account data." work like this?
_USD_Onhand = Portfolio.CashBook["USD"].Amount;
just like when i
SetCash(_startingCash);
//SetCash("BTC", 0.001m);
in my init()
I guess i'm asking you how GDAX will behave in that example and maybe no one knows ;)
I am Canadian and coinbase pro will not let me trade any XXX-USD pairs but it will allow XXX-USDC and everything else. So if just dump some BTC in my account will the algo just work in live trading as it does in backtesting or am i missing something?
Shile Wen
Hi Dean,
The
_USD_Onhand = Portfolio.CashBook["USD"].Amount;
will just be 0 because there is no USD in the account. The algo should work in live trading as long as BTC is used to buy the other types of coins, e.g. through buying BTCETH.Best,
Shile Wen
Dean Kuntz
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!