I have an algorithm running live on IB. It started this morning. I am getting Red Toast "Order rejected by brokerage. Potential Pattern Day Trading" or something like that. I admit this algorithm makes a lot of trades. Has anyone else heard of this rejection by the brokerage?
Christoffer Sí¸rensen
JP B
Nicholas Stein
Christoffer Sí¸rensen
Jared Broad
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.
Nicholas Stein
Christoffer Sí¸rensen
JP B
Christoffer Sí¸rensen
Nicholas Stein
Christoffer Sí¸rensen
Ray Bohac
Jared Broad
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.
Nicholas Stein
Nicholas Stein
Nicholas Stein
Erik Bengtson
Hi,
Is there a way to perform the rounding according to the Symbol requirements before I place the order?
I mean, instead of hard coding the rounding digits by symbol myself, is there any function that can perform that for me?
Thanks,
Below are two sample warnings:
2017-11-20 09:45:00 Warning: To meet brokerage precision requirements, order StopPrice was rounded to 1.16252 from 1.1625242077330199800
2017-11-20 19:54:01 Warning: To meet brokerage precision requirements, order StopPrice was rounded to 130.585 from 130.58502686162018200
Erik Bengtson
Found the solution to my question. Adjusting to rounding requirements can be done with this code:
var increment = _portfolio.Securities[pair].PriceVariationModel.GetMinimumPriceVariation(_portfolio.Securities[pair]); if (increment != 0) { stopLossPrice = Math.Round(stopLossPrice / increment) * increment; }
Alexandre Catarino
Erik Bengtson, those warning are telling you that the engine is doing the rounding.
It was introduced because some brokerages only accept rounded prices and we didn't want users to worry about it, so the engine does the job and sends a warning so that the user knows that the price it was calculated was slightly modified.
Nicholas Stein
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!