![]() |
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
|
|||||||
| Strategy Development Support for the development of custom automated trading strategies using NinjaScript. |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Member
Join Date: Apr 2008
Location: Fenton, MI
Posts: 33
Thanks: 0
Thanked 0 times in 0 posts
|
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) |
|
|
|
| Thread Tools | |
| Display Modes | |
|
|
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 |