NinjaTrader Support Forum  

Go Back   NinjaTrader Support Forum > NinjaScript Development Support > Strategy Development

Strategy Development Support for the development of custom automated trading strategies using NinjaScript.

Reply
 
Thread Tools Display Modes
Old 10-14-2008, 09:51 PM   #1
michaelbb
Member
 
Join Date: May 2008
Posts: 42
Thanks: 0
Thanked 0 times in 0 posts
Default CS0029 with EnterShortStop

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)
michaelbb is offline  
Reply With Quote
Old 10-15-2008, 08:18 AM   #2
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 107 times in 70 posts
Default

Hi michaelbb,

You will want to first do this in Variables:
Code:
private IOrder entryorder = null;
Then in OnBarUpdate() where you want to place the order:
Code:
entryOrder = EnterShortStop(1, entry);
http://www.ninjatrader-support.com/H...V6/IOrder.html
NinjaTrader_Josh is offline  
Reply With Quote
Old 10-15-2008, 08:37 AM   #3
michaelbb
Member
 
Join Date: May 2008
Posts: 42
Thanks: 0
Thanked 0 times in 0 posts
Default

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)
michaelbb is offline  
Reply With Quote
Old 10-15-2008, 08:44 AM   #4
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 107 times in 70 posts
Default

Hi michaelbb,

I see what you mean now. Thanks for bringing this to our attention. I will get in contact with development.
NinjaTrader_Josh is offline  
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Entershortstop not reversing long position and vice versa verge Strategy Development 1 05-02-2008 07:42 AM
EnterLongStop and EnterShortStop Mathemagician Strategy Development 6 02-01-2008 04:38 PM


All times are GMT -6. The time now is 03:52 AM.