PDA

View Full Version : CS0029 with EnterShortStop


michaelbb
10-14-2008, 09:51 PM
IOrder entryOrder = EnterShortStop(1,entry);

results in CS0029 - Cannot implicitly convert type void to NinjaTRader.Cbi.IOrder

Other overloaded EnterShortStop methods work fine and return a IOrder Object (as documented).

Version is 6.5.1000 (Live)

NinjaTrader_Josh
10-15-2008, 08:18 AM
Hi michaelbb,

You will want to first do this in Variables:
private IOrder entryorder = null;
Then in OnBarUpdate() where you want to place the order:
entryOrder = EnterShortStop(1, entry);
http://www.ninjatrader-support.com/HelpGuideV6/IOrder.html

michaelbb
10-15-2008, 08:37 AM
Hi Josh,

my code was to demonstrate the compiler error.

Is your code compiled on your NinjaTrader version?

On my version the EnterShortStop method is defined as:

void EnterShortStop(int quantity, double stopPrice)

It should be:

IOrder EnterShortStop(int quantity, double stopPrice)

NinjaTrader_Josh
10-15-2008, 08:44 AM
Hi michaelbb,

I see what you mean now. Thanks for bringing this to our attention. I will get in contact with development.