![]() |
|
|||||||
| Strategy Development Support for the development of custom automated trading strategies using NinjaScript. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Junior Member
Join Date: Oct 2011
Posts: 10
Thanks: 1
Thanked 1 time in 1 post
|
if I have a live strategy running (that opened a position) and I manually close the position - will the following statement see a flat account (from within my active strategy):
privatebool Flat { get { return Position.MarketPosition == MarketPosition.Flat; } } I am asking because it seems that if the strategy opens a position, then it will not return TRUE until the strategy closes the position (is this correct ?) And if it is correct, how can I tell from within the strategy that the position is no longer open (so I can have the strategy stop managing the trade) ? This seems to be the case also if a position is open from a historical bar and then it catches up to the latest bar - but keeps the position open when in reality there is no open position). |
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: Sep 2009
Location: Denver, CO
Posts: 8,117
Thanks: 249
Thanked 418 times in 415 posts
|
Hi Greg,
That property only reads the strategy position, which is generated based on orders that the strategy manages. If you manually close an account position, this has no effect on the strategy position. http://www.ninjatrader.com/support/h..._account_p.htm NinjaScript strategies are designed as fully automated solutions, so there's no way to "tell" the strategy position your current account position. The strategy position is based only on the ruleset of your strategy and its management of orders. If you're looking for a model where the strategy opens a position but then you manually manage the exits, check into NinjaScript > ATM integration: http://www.ninjatrader.com/support/h...strategies.htm
Ryan M
NinjaTrader Customer Service |
|
|
|
|
The following user says thank you to NinjaTrader_RyanM for this post: |
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How can I trade manually to compare my strategy | golden zhao | Strategy Development | 3 | 02-22-2011 04:40 PM |
| How can I manually trade and auto trade with IB at the same time? | pipal | Automated Trading | 21 | 01-04-2011 05:58 PM |
| Close positions with a strategy after a manually placed trade | MicroTrends | Strategy Development | 1 | 04-01-2010 05:50 AM |
| Manually moving/closing Strategy Stops/Targets | gg80108 | ATM Strategies (Discretionary Trading) | 1 | 03-14-2009 11:56 AM |
| Manually closing one of the orders at market in ATM | junmachan | ATM Strategies (Discretionary Trading) | 1 | 07-23-2008 05:52 PM |