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 > Indicator Development

Indicator Development Support for the development of custom indicators using NinjaScript.

Reply
 
Thread Tools Display Modes
Old 08-20-2009, 03:24 PM   #1
DancesWithBears
Member
 
Join Date: Jul 2009
Posts: 53
Thanks: 0
Thanked 0 times in 0 posts
Default How to programatically determine if I am in a trade?

I need to write an indicator that searches for different conditions once a trade has been entered.

How do I do this?

Thru the Performance.RealtimeTrades.Count ?
DancesWithBears is offline  
Reply With Quote
Old 08-20-2009, 03:28 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

Performance does not return you things until your trade is complete. If you want to do things from when you enter a trade you would want to detect changes in Position.MarketPosition and Position.Quantity to determine that you have entered a trade.
NinjaTrader_Josh is offline  
Reply With Quote
Old 08-20-2009, 03:50 PM   #3
DancesWithBears
Member
 
Join Date: Jul 2009
Posts: 53
Thanks: 0
Thanked 0 times in 0 posts
Default

Think I got it.

My indicator has to poll the Position object for changes.

or I could implement :

The OnPositionUpdate() method



Quote:
Originally Posted by NinjaTrader_Josh View Post
Performance does not return you things until your trade is complete. If you want to do things from when you enter a trade you would want to detect changes in Position.MarketPosition and Position.Quantity to determine that you have entered a trade.
DancesWithBears 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
Choosing PriceType Programatically? darckeen Indicator Development 5 01-15-2011 08:38 PM
programatically set stop /strategy junkone Strategy Development 1 04-30-2009 05:38 AM
Determine trade size in real-time and backtest tomace Strategy Development 2 04-29-2009 04:43 PM
Export Data Grid Programatically? mktrend General Programming 10 01-05-2009 10:07 AM
Programatically Change To Sim CashCache Strategy Development 3 03-10-2008 09:55 PM


All times are GMT -6. The time now is 10:04 AM.