Hey,
first i would like to congrats the team that worked on this project they did a nice job for what i have seen so far ! now the documentation could be ... u know a bit more ... simple we could say ^^.
Now i have some question that i hope u can help me with :
- how to get the aviable fund of the account ? ( for both backtesting and live )
- how to get a list of current open trade without needing us to remeber them on var ?
- is it possible to change the leverage each time we make a market order ?
- is there like a chat or something where we can ask question to other programmer in live ?
- finaly when we create a StopMarketOrder is this applied to the last opened order ?
I may have found it somewhere i know but i could't manage to do it in the first two hours so i come to u guys i hope u will understand. Thanks for the help and excuse me for my english, not my main language.
Alexandre Catarino
Portfolio.RemainingMargin is the available amount of fund you have at any given moment. It has the same value as Portfolio.Cash when there isn't any open position. Also, Cash should not be mistaken for margin available because Forex uses margin even though the total cash value is not impact.
For looking into the all positions (current and past), we can rely on the Transaction object. For open order and tickets:
List<Order> openOrders = Transactions.GetOpenOrders();
List<OrderTicket> openOrderTickets = Transactions.GetOrderTickets(x => x.Status.IsOpen());
Yes, you can change the leverage at any time, using SetLeverage from the Security object that you can access by its ticker in the Securities object:
Securities["SPY"].SetLeverage(1);
To get support from the team here at QuantConnect use the help tab on the left of the IDE.
I don't know whether I undestood your question about the StopMarketOrder. Could you give a practical example?
Hey first thanks for ur answer i realy appreciate !
And i found my anser for the StopMarketOrder thanks
Sorry for disturbing u
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!