NinjaTrader Support Forum  
X

Attention!

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


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 08-06-2012, 12:40 PM   #1
marcusplexus
Member
 
Join Date: Jan 2010
Posts: 73
Thanks: 11
Thanked 1 time in 1 post
Default Manual trade entered, then strategy should close the trade

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
marcusplexus is offline  
Reply With Quote
Old 08-06-2012, 12:47 PM   #2
NinjaTrader_Joydeep
NinjaTrader Customer Service
 
NinjaTrader_Joydeep's Avatar
 
Join Date: Dec 2011
Location: India
Posts: 3,286
Thanks: 580
Thanked 546 times in 541 posts
Default

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).
NinjaTrader_Joydeep is offline  
Reply With Quote
The following user says thank you to NinjaTrader_Joydeep for this post:
Old 08-08-2012, 04:29 AM   #3
Klaus Hengher
Member
 
Join Date: Apr 2009
Posts: 55
Thanks: 5
Thanked 6 times in 4 posts
Default

it should work with undocumented methods

1.) get Position for instrument with Account.Positions
2.) close position with Position.Close() method
Klaus Hengher is offline  
Reply With Quote
The following 2 users say thank you to Klaus Hengher 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
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


All times are GMT -6. The time now is 08:35 PM.