Chart type used: Tick chart
NinjaScript OnBarUpdate() interval: Calculate On Each Tick
Using NinjaScript, is there any way to submit a market order that executes on the open of the upcoming/next bar? For example:
Say I have a strategy that calculates on each tick and generates an intra-bar 'buy' or 'sell' condition that executes a market order "EnterLong() or EnterShort()" -- In live testing, this will execute an order immediately upon meeting the buy or sell condition. Ideally, I want to be able to precisely control when the strategy enters an order while still assessing the data on a tick-by-tick basis (similar to the MultiCharts function 'OrderCreator.MarketNextBar'). I've attempted to code around it with a tick counter and a boolean for the buy/sell condition that essentially holds the script in a loop until the bar -- which triggered the condition -- is finished; then Enter (Market Order) long/short... However, there's got to be a better, easier way to do this.
Please advise, or create a feature request to add additional market entry functions to allow "quant/algo" traders to finely tune their entry times (i.e. EnterLongNextBarOpen(), EnterLongNextBarClose(), EnterLongThisBarClose() -- same for short side of course).
Thanks!
Comment