Hi everyone, we are excited to introduce the new terminal design! The community has already started providing helpful feedback across numerous channels, but we wanted to create this thread a central place for discussion.
For reporting bugs or asking about functionalities, please submit according to the format below:
- What happened? (i.e. "my backtest won't open")
- When? (i.e. "anytime I try to open a backtest from my project")
- Where? (i.e. "the 'My Projects' view")
- Console Information: please provide any relevant information from the browser console, accessible in Chrome with ctrl+shift+i or in Firefox with ctrl+shift+e. Potentially relevant information will likely have a red or yellow background.
- If possible, provide a screenshot.
Jared Broad
Hi Olivier; the generic answer to that question is in the API tab on the left side of the IDE. We actually have more examples of python than C# now! =) The Order Ticket example link is below.
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.
Garyha
From the link above:
# submit another limit order to sell 10 shares at .1% above the bar's close newTicket = self.LimitOrder(self.spy, -10, close * d.Decimal(1.001)) self.__openLimitOrders.append(newTicket)
What if you want to close the position? How do you programmatically obtain the current number of shares and what would that look like in place of "10"?
More specifically, I'd like to set stop and limit for closing positions as soon as limit orders to open them have filled, and this would need correcting
def OnOrderEvent(self, OrderEvent): if OrderEvent.Status == OrderStatus.PartiallyFilled: self.Log(' partial {}'.format(OrderEvent.Symbol)) elif OrderEvent.Status == 3 and OrderEvent.FillQuantity > 0: self.Log(' filled {} {}'.format(OrderEvent.FillQuantity, OrderEvent.Symbol)) self.LimitOrder( OrderEvent.Symbol, -self.Securities[OrderEvent.Symbol].Quantity, self.Securities[OrderEvent.Symbol].Price * decimal.Decimal(1.02), tag='') self.StopMarketOrder(OrderEvent.Symbol, -self.Securities[OrderEvent.Symbol].Quantity, self.Securities[OrderEvent.Symbol].Price * decimal.Decimal(.99), tag='')
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.
Garyha
-self.Portfolio[OrderEvent.Symbol].Quantity for the current number of shares. This is in OnOrderEvent()
self.LimitOrder(OrderEvent.Symbol, -self.Portfolio[OrderEvent.Symbol].Quantity, self.Securities[OrderEvent.Symbol].Price * decimal.Decimal(1.02), tag='')
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.
Michael Manus
check also the docu for canceling specific orders:
# Creating an Order: limitOrderTicket = self.LimitOrder("SPY", 100, 205) # Updating an Order: updateOrderFields = UpdateOrderFields() updateOrderFields.LimitPrice = decimal.Decimal(207.50) limitOrderTicket.Update(updateOrderFields) # Cancel an Order: limitOrderTicket.Cancel() # Cancel all open orders from SPY cancelledOrders = self.Transactions.CancelOpenOrders("SPY") # Cancel order #10 cancelledOrder = self.Transactions.CancelOrder(10) # Get open orders openOrders = self.Transactions.GetOpenOrders() # Get open orders from SPY openOrders = self.Transactions.GetOpenOrders("SPY") # Get open order #10 openOrder = self.Transactions.GetOrderById(10) # Get all orders orders = self.Transactions.GetOrders() # Get order ticket #10 orderTicket = self.Transactions.GetOrderTicket(10) # Get all orders tickets openOrderTickets = self.Transactions.GetOrderTickets()
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.
Patrick Verhoeven
Can I simply say Price*Quantity<$10 then ignore?
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.
Louis Szeto
Hi Patrick
Please refers to this thread. Thanks!
Best
Louis
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.
Jared Broad
Hi Olivier; the generic answer to that question is in the API tab on the left side of the IDE. We actually have more examples of python than C# now! =) The Order Ticket example link is below.
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.
Garyha
From the link above:
# submit another limit order to sell 10 shares at .1% above the bar's close newTicket = self.LimitOrder(self.spy, -10, close * d.Decimal(1.001)) self.__openLimitOrders.append(newTicket)
What if you want to close the position? How do you programmatically obtain the current number of shares and what would that look like in place of "10"?
More specifically, I'd like to set stop and limit for closing positions as soon as limit orders to open them have filled, and this would need correcting
def OnOrderEvent(self, OrderEvent): if OrderEvent.Status == OrderStatus.PartiallyFilled: self.Log(' partial {}'.format(OrderEvent.Symbol)) elif OrderEvent.Status == 3 and OrderEvent.FillQuantity > 0: self.Log(' filled {} {}'.format(OrderEvent.FillQuantity, OrderEvent.Symbol)) self.LimitOrder( OrderEvent.Symbol, -self.Securities[OrderEvent.Symbol].Quantity, self.Securities[OrderEvent.Symbol].Price * decimal.Decimal(1.02), tag='') self.StopMarketOrder(OrderEvent.Symbol, -self.Securities[OrderEvent.Symbol].Quantity, self.Securities[OrderEvent.Symbol].Price * decimal.Decimal(.99), tag='')
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.
Garyha
-self.Portfolio[OrderEvent.Symbol].Quantity for the current number of shares. This is in OnOrderEvent()
self.LimitOrder(OrderEvent.Symbol, -self.Portfolio[OrderEvent.Symbol].Quantity, self.Securities[OrderEvent.Symbol].Price * decimal.Decimal(1.02), tag='')
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.
Michael Manus
check also the docu for canceling specific orders:
# Creating an Order: limitOrderTicket = self.LimitOrder("SPY", 100, 205) # Updating an Order: updateOrderFields = UpdateOrderFields() updateOrderFields.LimitPrice = decimal.Decimal(207.50) limitOrderTicket.Update(updateOrderFields) # Cancel an Order: limitOrderTicket.Cancel() # Cancel all open orders from SPY cancelledOrders = self.Transactions.CancelOpenOrders("SPY") # Cancel order #10 cancelledOrder = self.Transactions.CancelOrder(10) # Get open orders openOrders = self.Transactions.GetOpenOrders() # Get open orders from SPY openOrders = self.Transactions.GetOpenOrders("SPY") # Get open order #10 openOrder = self.Transactions.GetOrderById(10) # Get all orders orders = self.Transactions.GetOrders() # Get order ticket #10 orderTicket = self.Transactions.GetOrderTicket(10) # Get all orders tickets openOrderTickets = self.Transactions.GetOrderTickets()
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.
Patrick Verhoeven
Can I simply say Price*Quantity<$10 then ignore?
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.
Louis Szeto
Hi Patrick
Please refers to this thread. Thanks!
Best
Louis
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.
Jared Broad
Hi Olivier; the generic answer to that question is in the API tab on the left side of the IDE. We actually have more examples of python than C# now! =) The Order Ticket example link is below.
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.
Garyha
From the link above:
# submit another limit order to sell 10 shares at .1% above the bar's close newTicket = self.LimitOrder(self.spy, -10, close * d.Decimal(1.001)) self.__openLimitOrders.append(newTicket)
What if you want to close the position? How do you programmatically obtain the current number of shares and what would that look like in place of "10"?
More specifically, I'd like to set stop and limit for closing positions as soon as limit orders to open them have filled, and this would need correcting
def OnOrderEvent(self, OrderEvent): if OrderEvent.Status == OrderStatus.PartiallyFilled: self.Log(' partial {}'.format(OrderEvent.Symbol)) elif OrderEvent.Status == 3 and OrderEvent.FillQuantity > 0: self.Log(' filled {} {}'.format(OrderEvent.FillQuantity, OrderEvent.Symbol)) self.LimitOrder( OrderEvent.Symbol, -self.Securities[OrderEvent.Symbol].Quantity, self.Securities[OrderEvent.Symbol].Price * decimal.Decimal(1.02), tag='') self.StopMarketOrder(OrderEvent.Symbol, -self.Securities[OrderEvent.Symbol].Quantity, self.Securities[OrderEvent.Symbol].Price * decimal.Decimal(.99), tag='')
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.
Garyha
-self.Portfolio[OrderEvent.Symbol].Quantity for the current number of shares. This is in OnOrderEvent()
self.LimitOrder(OrderEvent.Symbol, -self.Portfolio[OrderEvent.Symbol].Quantity, self.Securities[OrderEvent.Symbol].Price * decimal.Decimal(1.02), tag='')
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.
Michael Manus
check also the docu for canceling specific orders:
# Creating an Order: limitOrderTicket = self.LimitOrder("SPY", 100, 205) # Updating an Order: updateOrderFields = UpdateOrderFields() updateOrderFields.LimitPrice = decimal.Decimal(207.50) limitOrderTicket.Update(updateOrderFields) # Cancel an Order: limitOrderTicket.Cancel() # Cancel all open orders from SPY cancelledOrders = self.Transactions.CancelOpenOrders("SPY") # Cancel order #10 cancelledOrder = self.Transactions.CancelOrder(10) # Get open orders openOrders = self.Transactions.GetOpenOrders() # Get open orders from SPY openOrders = self.Transactions.GetOpenOrders("SPY") # Get open order #10 openOrder = self.Transactions.GetOrderById(10) # Get all orders orders = self.Transactions.GetOrders() # Get order ticket #10 orderTicket = self.Transactions.GetOrderTicket(10) # Get all orders tickets openOrderTickets = self.Transactions.GetOrderTickets()
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.
Patrick Verhoeven
Can I simply say Price*Quantity<$10 then ignore?
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.
Louis Szeto
Hi Patrick
Please refers to this thread. Thanks!
Best
Louis
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!