Nt8 calculated target order price was smaller/equal 0 no target order placed

My strategy didn’t trade last night because…

“nt8 calculated target order price was smaller/equal 0 no target order placed”

The order was a simple quantity market order on MNQ.

What the hell? I’ve run it through the Strategy Analyzer with the same resulting error.

if your target order price is the issue, we’re gonna need the logic that assigns your target order price it’s value.

Hi, Thanks for getting back to me. This error is sporadic. The calculation is on MNQ with standard candlestick charts.

			if ((QX_QUANTITYENTRY == true))
			{
				EnterLong(QX_ENTRYQUANTITYFIXED, "LE");
			}

			if ((QX_PERCENTATRISKBASEDPOSITIONSIZING == true))
			{
				EnterLong(QX_OrderQuantityPERCENTAGERISKBASED, "LE");
			}

They’re both just Enter Long market, Quantity, signal name to print

Thanks.

that is weird. It doesn’t require any target order…do you have any code that you would use a target somewhere? A google search with your error comes up with nothing. Sorry

@FauxBogan I suspect the relevant code isn’t the EnterLong() block. Since EnterLong() is just a market entry, the issue is more likely to be in the code that calculates or submits the profit target after the entry signal.

1 Like

That message comes from the managed profit target, not from EnterLong. When the entry fills, NinjaTrader turns whatever SetProfitTarget() currently holds into a price, and if that works out to zero or below it skips the target. It’s sporadic because the input is: typically a Price-mode target from a variable still 0 on that bar, or ATR, risk or currency math that isn’t ready yet. Search the code for SetProfitTarget, print its value just before each EnterLong, and only enter when it’s above zero. Calling SetProfitTarget right before the entry also avoids a stale value from the last trade. Happy to help further, feel free to DM me.

1 Like