![]() |
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
|
|||||||
| Strategy Development Support for the development of custom automated trading strategies using NinjaScript. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Member
Join Date: Jan 2010
Posts: 73
Thanks: 11
Thanked 1 time in 1 post
|
Hi,
I want to create a strategy that will close a position entered previously, most likely manually. Using Simulated Data Feed I shorted a contract, then enabled the script. I have log messages generated to let me know what's happening with the script's logic. The section asking to close a (short) position gets executed but the ExitShort() method is not working. The Dynamic SuperDom shows I still have a contract short. What do I need to do to get this running properly? Thanks in advance. mp |
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: Dec 2011
Location: India
Posts: 3,286
Thanks: 580
Thanked 546 times in 541 posts
|
Hello marcusplexus,
A NinjaScript strategy can close any position created by itself only. It cannot close a position which was created manually (using SuperDom or ChartTrader etc).
Joydeep M.
NinjaTrader Customer Service |
|
|
|
|
The following user says thank you to NinjaTrader_Joydeep for this post: |
|
|
|
#3 |
|
Member
Join Date: Apr 2009
Posts: 55
Thanks: 5
Thanked 6 times in 4 posts
|
it should work with undocumented methods
1.) get Position for instrument with Account.Positions 2.) close position with Position.Close() method |
|
|
|
|
The following 2 users say thank you to Klaus Hengher for this post: |
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Profit/Loss since trade entered | arbuthnot | Strategy Development | 9 | 08-06-2012 05:58 PM |
| Close positions with a strategy after a manually placed trade | MicroTrends | Strategy Development | 1 | 04-01-2010 05:50 AM |
| SampleIntrabarBacktest - Premataure Exit at close of the day the trade was entered | tonyh | Strategy Development | 7 | 03-15-2010 02:33 PM |
| Unable to close a trade | buckeye | SuperDOM and other Order Entry Windows | 6 | 01-22-2010 02:11 PM |
| Enter trade at open and exit trade at close | d.allen101 | Strategy Development | 3 | 11-11-2009 10:02 AM |