Back

Documentation discussion algorithm-reference/trading-and-orders

Update Backtest







0

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.


Is there any Trailing Stop Loss order type? If not, why?

8

Hi Roland Le Franc, we have an open GitHub issue about it:
Add support for Trailing Stop Orders #2580
There is no particular reason other than it is more complex than the other types and there was no demand.

1

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.


I have a question - is there any way of forcing the price to be taken by an order while backtesting? Ie I would like to enter long position with ask price and close long position with bid price. Or, to open a position with Open and close that with the next after a trigger Bar Open. How can I implement that in code? 

Thanks a lot for answering. 

0

Hi Andrey,

LEAN supports custom fill models which can be used to force order fulfillment based on customized criteria. The documentation section can help illustrate how these might be implemented.

0

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.


Building an algo using OandaBrokerageModel, not sure how best handle:

"Backtest Handled Error: OrderID: 1 Warning - Code: NotSupported - The OandaBrokerageModel does not support MarketOnOpen order type" 

From what I've read, a signal a trade signal is generated, I call SetHoldings(_fx.Symbol,1); or Liquidate(_fx.Symbol); and a market order is attempted.  However, because the order cannot be filled in the current session it is converted into a MarketOnOpen, which is not supported by FXCM or Oanda.   My question is, how do I get arround this?

 

The last piece of information I gathered from Alexandre Catarino's post here: 

https://www.quantconnect.com/forum/discussion/1761/just-downloaded-lean-have-a-few-questions/p1
0

Update Backtest





0

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.


Loading...

This discussion is closed

 
";