As a beginner in c# I would very much appreciate if someone could post a simple template (e.g.: ema crossover) which is all set up to be used with a fxcm (test) account (cfds and forex).
Thanks in advance!
QUANTCONNECT COMMUNITY
As a beginner in c# I would very much appreciate if someone could post a simple template (e.g.: ema crossover) which is all set up to be used with a fxcm (test) account (cfds and forex).
Thanks in advance!
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.
Alexandre Catarino
When the algorithm trades securities that are supported by the brokerage, we do not need a special setup. We can run the same algorithm for FXCM and Oanda.
However, we want to run backtests that emulate a particular brokerage, we can set it up (please check out the docs under Reality Modelling section):
// In Initialize method // Set brokerage model using helper methods: SetBrokerageModel(BrokerageName.FxcmBrokerage); // Defaults to margin account SetBrokerageModel(BrokerageName.TradierBrokerage, AccountType.Cash); //Or override account type // Supported brokerage names: BrokerageName.FxcmBrokerage .OandaBrokerage .TradierBrokerage .InteractiveBrokersBrokerage
Andreas Dekrout
thanks Alexandre,
so when I run abacktest I need to set
SetBrokerageModel(BrokerageName.FxcmBrokerage);but when I want to go "live" on a test or real account I wouldnt need to set anything, right?
best,
Andreas.
Alexandre Catarino
Right. On live mode, some of the settings we made on Initialize are discarded, SetBrokerageModel is one of those.
Andreas Dekrout
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!