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 > Application Technical Support > Strategy Analyzer

Strategy Analyzer Support for automated system backtesting and optimization using the NinjaTrader Strategy Analyzer.

Reply
 
Thread Tools Display Modes
Old 12-19-2008, 08:54 AM   #1
ag987654321
Member
 
Join Date: Dec 2008
Posts: 32
Thanks: 0
Thanked 0 times in 0 posts
Default Exiting Longs (or shorts) one at a time rather than all at once?

Hi guys,

Has anyone noticed if you are running a strategy that can be long and short that the move from long to short happens all at once?

I am trying to write a strategy that is going to scale into and scale out of positions rather than exit the whole positions and goes short. I have tried to do this by avoiding using {default quantity} and using a fixed amount of 1 but no luck so far...

That will let me accumulate a position (one at a time) but when the sell signal comes along the strategy sells the whole accumulated position and goes short 1.

Am I missing something?

Thanks
Alex
ag987654321 is offline  
Reply With Quote
Old 12-19-2008, 09:15 AM   #2
NinjaTrader_Ben
NinjaTrader Customer Service
 
NinjaTrader_Ben's Avatar
 
Join Date: May 2008
Location: Denver, CO
Posts: 3,157
Thanks: 0
Thanked 3 times in 3 posts
Default

Hello,

There are two things going on here if I understand you correctly:
1) You are scaling into your reversal so you will have both a long and a short trade/orders open at the same time.

You cannot be both long and short within the same market literally.

2) To prevent orders from being both long and short the orders to enter have an embedded method to close opposing orders automatically. So when you enter a long position and you already have a short position open, the long position is automatically closed.

This link has information on this:
http://www.ninjatrader-support.com/H...verview36.html
NinjaTrader_Ben is offline  
Reply With Quote
Old 12-19-2008, 09:42 AM   #3
ag987654321
Member
 
Join Date: Dec 2008
Posts: 32
Thanks: 0
Thanked 0 times in 0 posts
Default

Nope that is not what I am asking.
don't want to be "long" AND "short"

What i want is if I am long 10... and i get a sell signal- i would like to sell 1 (net possie of 9)


On the next sell signal I would like to sell another 1 (net possie of 8)

and on the next buy signal buy 1 (net possie of 9)

and so on...

can this be done?

Thanks
Alex
ag987654321 is offline  
Reply With Quote
Old 12-19-2008, 10:09 AM   #4
NinjaTrader_Ben
NinjaTrader Customer Service
 
NinjaTrader_Ben's Avatar
 
Join Date: May 2008
Location: Denver, CO
Posts: 3,157
Thanks: 0
Thanked 3 times in 3 posts
Default

Hello,

To scale out you will need to scale in. There is only one ExitLong() for each EnterLong().

This link has an example:
http://www.ninjatrader-support2.com/...ead.php?t=3751
NinjaTrader_Ben is offline  
Reply With Quote
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 load/unload external dll not exiting NT every time? maxima General Programming 7 01-19-2009 08:43 AM
Hedging Longs and Shorts three faced devil Strategy Development 8 11-05-2008 08:24 AM
Counting stop losses on the Longs and Shorts stefy Strategy Development 1 06-27-2008 06:15 AM
Strategy: Entering on one time frame and exiting on another NinjaTrader_Josh Reference Samples 0 02-23-2008 04:29 PM
Long trade, executing shorts Dunthrin Automated Trading 15 07-11-2007 09:49 AM


All times are GMT -6. The time now is 12:47 AM.