NinjaTrader Support Forum  

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 03-01-2012, 12:37 PM   #1
gregm
Junior Member
 
Join Date: Oct 2011
Posts: 10
Thanks: 1
Thanked 1 time in 1 post
Default manually closing a trade a strategy has opened

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).


gregm is offline  
Reply With Quote
Old 03-01-2012, 12:45 PM   #2
NinjaTrader_RyanM
NinjaTrader Customer Service
 
NinjaTrader_RyanM's Avatar
 
Join Date: Sep 2009
Location: Denver, CO
Posts: 8,117
Thanks: 249
Thanked 418 times in 415 posts
Default

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
NinjaTrader_RyanM is offline  
Reply With Quote
The following user says thank you to NinjaTrader_RyanM for this post:
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
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


All times are GMT -6. The time now is 11:44 PM.