Back

Check minimum tick size increment

Certain stocks have a min tick increment size of .05 rather than .01. So for example if I try to create a stop order at $12.03 for a .05 tick it will reject my order. How do I check for the minimum tick increment of a particular security? If I can't, then how do I identify that a stop order was just rejected because I didn't conform to the min tick increment?

I am trying out the code below but am not sure whether the status would be cancelled or invalid whenever the tick size issue happens. 

if (fill.Status.ToString() == "Canceled" || fill.Status.ToString() == "Invalid" && Securities[fill.Symbol].Invested)
{
stopTickets.First(x => x.Symbol == fill.Symbol).Update(new UpdateOrderFields { StopPrice = Math.Round(calcStop(dir, fill.FillPrice) * 20) / 20 });
}

 

Update Backtest








The information on the symbol properties can be found on the Security object:

var properties = Securities["SPY"].SymbolProperties;
var lotSize = properties.LotSize;
var minPriceVar = properties.MinimumPriceVariation;
var multiplier = properties.ContractMultiplier;

 

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.


Great this is exactly what I was looking for!

0

Sorry Sofyan Saputra this is actually not modelled in LEAN. The value above will always be 0.01 as its using a symbol configuration file for LEAN which isn't historically adjusted.

The best setup we could offer right now is to use Raw price data which will not adjust the prices and you'll get the splits and dividends paid out directly. This way you'll get the real increments that are present in the data.

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.


Jared Broad Thanks for letting me know. I think I will get around the issue by submitting a stop limit at a .05 increment if the stock's last 10 bars or so of history only had prices of .05 increments. This should be accurate most of the time. 

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