Hello everyone,
I'm very new to the topic of algo-trading and my C# skills are a little rusty.
But from my point of view my (very very basic) code should buy EURUSD, the log says it does. But no trades are executed.
Thank in you in advance for reviewing my code.
br.
Johannes Ferner
It seems that the Order() is not taking the leverage into account.
So the quantity has to be quantity*leverage
Is there any more information on those constraints?
Jared Broad
The quantity here is the number of individual units (not lots). For a MarketOrder of "100" its too small and rounded to 0 (minimum lot size is 1000 units). This is by design as brokerages typically have minimum lot sizes.
If you want more automated / mathematical ways to set this you can use SetHoldings() which takes a percentage of assets where "1" is 100%, and "50" is full utilization of 50x leverage.
There is more information on this in the documentation.
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.
Johannes Ferner
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!