Back

CustomFeeModel, order.Value returns 0

Hey all,
So i'm trying to use a custom fee model with an override, but the order.Value parameter in GetOrderFee(Security security, Order order) function returns 0, any thoughts?

One more thing, can you access the raw, unadjusted price data and send it to the order fee function? The idea is to simulate the order fees more accurately.

Any help is appreciated! :)
Robert
Update Backtest








Order.Value should be deprecated @Robert, we changed all the code to use the snippet below since order values depend on the type of order and market price.
order.GetValue(decimal currentMarketPrice)

You can set the data normalization mode by security:
security.SetDataNormalizationMode(DataNormalizationMode mode) to choose different data normalization modes. You could capture the split/dividend events and work backwards somehow to get the raw price. It might just be a little tricky.
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.


I see, but how do i get the price inside GetOrderFee? order.Price also returns 0
0

security.Price should work?

order.Price is the fill price for the order, which isn't set until the fill models.
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.


Problem solved, thanks Jared!
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