NinjaTrader Support Forum  
X

Attention!

This website will be down for maintenance from Friday May 24th at 6PM MDT until Sunday May 26th at 12PM 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.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old 08-19-2008, 02:13 PM   #1
Jeff 15
Member
 
Join Date: Apr 2008
Location: Fenton, MI
Posts: 33
Thanks: 0
Thanked 0 times in 0 posts
Question Multiple positions

I am working on a stategy that enters two positions short. I have my "entry handling" set to AllEntries, and 2 per direction. The problem is I dont want the strategy to open any additional trades until both trades are flat. I have tried the following code but it still continies to open new trades. Can you please give me some hints or point me in the right direction?

protectedoverridevoid OnBarUpdate()
{
// Only allow entries if we have no current positions open
if (Position.MarketPosition == MarketPosition.Flat)
Jeff 15 is offline  
Reply With Quote
 

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
Positions.MarketPosition SystemTrading Miscellaneous Support 6 08-18-2008 09:55 AM
Multiple Positions with the Same Currency michaelphelps ATM Strategies (Discretionary Trading) 5 08-04-2008 11:52 AM
use Positions[0].MarketPosition Folls Strategy Development 2 10-17-2007 06:19 AM
overnight ES positions dbj Miscellaneous Support 1 05-23-2006 04:57 AM
Multiple positions gdargento Miscellaneous Support 1 12-15-2005 09:08 AM


All times are GMT -6. The time now is 02:23 PM.