NinjaTrader Support Forum  
X

Attention!

This website will be down for maintenance from Friday May 24th at 6PM MDT until Saturday May 25th at 11AM MDT. We apologize for the inconvenience. If you need assistance during this time, please email sales@ninjatrader.com


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-21-2009, 04:09 PM   #1
John833
Senior Member
 
Join Date: Jun 2008
Location: Hong Kong
Posts: 214
Thanks: 0
Thanked 0 times in 0 posts
Default Accessing price of limeit orders

Hello, if for example I have an ExitLongStop order working in the market, is it possible to access the price so it can be used in another calculation after its been placed?

Thanks
John833 is offline  
Reply With Quote
Old 10-21-2009, 04:12 PM   #2
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
Default

John833,

You would need to create an IOrder object to store the order and then you can access it to get the price.
NinjaTrader_Josh is offline  
Reply With Quote
Old 10-21-2009, 04:17 PM   #3
John833
Senior Member
 
Join Date: Jun 2008
Location: Hong Kong
Posts: 214
Thanks: 0
Thanked 0 times in 0 posts
Default

ok thanks....
John833 is offline  
Reply With Quote
Old 11-15-2009, 01:53 PM   #4
r2kTrader
Senior Member
 
Join Date: Sep 2008
Posts: 483
Thanks: 0
Thanked 2 times in 2 posts
Default

Josh,

Couldn't you also reference the object by name?
r2kTrader is offline  
Reply With Quote
Old 11-16-2009, 05:45 AM   #5
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,384
Thanks: 252
Thanked 967 times in 950 posts
Default

Not sure I follow r2kTrader - do you refer to something like this?

myExitLongStop.AvgFillPrice
NinjaTrader_Bertrand is offline  
Reply With Quote
Old 11-16-2009, 11:45 AM   #6
r2kTrader
Senior Member
 
Join Date: Sep 2008
Posts: 483
Thanks: 0
Thanked 2 times in 2 posts
Default

Hey Bertrand,

Actually I was referring to referencing an order by name rather than using token.

Quote:

protected overridevoid OnExecution(IExecution execution)
{
if (execution.Order.FromEntrySignal == "blah")
Print(execution.ToString());
}
Quote:
Originally Posted by NinjaTrader_Bertrand View Post
Not sure I follow r2kTrader - do you refer to something like this?

myExitLongStop.AvgFillPrice
r2kTrader is offline  
Reply With Quote
Old 11-16-2009, 11:49 AM   #7
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
Default

r2kTrader,

Technically, but you can have multiple executions for the same entry order and to access the accurate information of the whole order you would want to deal with the IOrder directly instead of a single execution.
NinjaTrader_Josh is offline  
Reply With Quote
Old 11-19-2009, 08:16 AM   #8
r2kTrader
Senior Member
 
Join Date: Sep 2008
Posts: 483
Thanks: 0
Thanked 2 times in 2 posts
Default

Quote:
Originally Posted by NinjaTrader_Josh View Post
r2kTrader,

Technically, but you can have multiple executions for the same entry order and to access the accurate information of the whole order you would want to deal with the IOrder directly instead of a single execution.
Josh,

But then you have to manually manage the order.

Can you cancel an order by name without using AOH?

While I think I am back to AOH because I can't get 100% of what I need without it, I would like to give the managed model one more shot before I give up.
r2kTrader is offline  
Reply With Quote
Old 11-19-2009, 08:59 AM   #9
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,384
Thanks: 252
Thanked 967 times in 950 posts
Default

Unfortunately you're back to AOH, since you need to refer to an IOrder object to cancel it specifically.
NinjaTrader_Bertrand 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
Limit Orders above and below price tradenoob Suggestions And Feedback 3 05-30-2009 06:14 AM
Accessing Price Data Outside of OnBarUpdate() phineas General Programming 4 04-01-2008 02:32 PM
Accessing the NINJA price database externally EvolveK General Programming 6 02-06-2008 10:34 AM
Limit orders filled at different price Richard Von SuperDOM and other Order Entry Windows 4 01-28-2008 12:02 PM
Accessing order fill price and quantity NinjaTrader_Ray Strategy Development 2 01-03-2008 12:16 AM


All times are GMT -6. The time now is 12:17 AM.