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 05-20-2009, 10:47 AM   #1
anothertoy
Member
 
Join Date: May 2009
Posts: 52
Thanks: 0
Thanked 0 times in 0 posts
Default enter long position in condition builder

Hi, within Condition Builder in Edit Strategy, I am trying to run 3 indicators each with its own long/short position so that the strategy is the combined outcome of the 3 indicators.

So if indicator 1 = 1 long, indicator 2=1 long and indicator 3=1 long, i want a net position of 3 long. When indicator 3 changes to 1 short, my Enter short position in Condition Builder forces the strategy to then go net 1 short instead of net 1 long (since indicator 1 and indicator 2 haven't changed).

I am using Enter long position and the Enter short position in Condition builder for each of the indicators and the indicators go from Long to Short with no flat position.

Is there another buy or sell command i can use that only affects the indicator involved?
anothertoy is offline  
Reply With Quote
Old 05-20-2009, 10:55 AM   #2
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
Default

anothertoy,

A strategy does not differentiate between where your positions come from. There is one overall strategy position and if you go EnterShort() from a long strategy position it will close that long position and then get you into a short position. If you do not want this and just want to close one long, submit ExitLong() instead of EnterShort() when you know you are already long.
NinjaTrader_Josh is offline  
Reply With Quote
Old 05-20-2009, 11:04 AM   #3
anothertoy
Member
 
Join Date: May 2009
Posts: 52
Thanks: 0
Thanked 0 times in 0 posts
Default

thanks but the problem with an exitlong or exit short, is that the indicator concerned will have a flat position but i want it to have the opposite position.

can i backtest a portfolio of strategies?
anothertoy is offline  
Reply With Quote
Old 05-20-2009, 11:11 AM   #4
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
Default

You cannot view each indicator as having its own position. A strategy has one position and you need to manage your orders based on that position. If you want to sell 2 then you need to close two of your original enter longs. You can run three separate strategies in three separate backtests and save the results, but you will need to aggregate results yourself with Excel.
NinjaTrader_Josh is offline  
Reply With Quote
Old 05-20-2009, 03:05 PM   #5
anothertoy
Member
 
Join Date: May 2009
Posts: 52
Thanks: 0
Thanked 0 times in 0 posts
Default

On a related note, will ninjatrader cope adequately with 40 separate strategies running at the same time if i split each indicator into a separate strategy to get around the position issue? i have a dual core intel 2.13ghz computer with 4gb of ram.

Or should i spend some time trying to cut down the number of strategies being run concurrently?

These strategies are being run on minimum 45min "close of bar" data and not tick data.
anothertoy is offline  
Reply With Quote
Old 05-20-2009, 03:13 PM   #6
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
Default

You can try it. It is highly dependent on how CPU intensive your algorithms are and how much historical data you are loading per strategy. Obviously less system load is better.
NinjaTrader_Josh 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
Plots under Parameter in Condition Builder dwt1020 General Programming 4 04-10-2009 08:01 AM
Possible Condition Builder Bug Elliott Wave Strategy Development 1 11-14-2008 10:59 AM
Help with Condition builder designer Strategy Development 14 10-30-2008 11:02 AM
Need help with Condition Builder amberwest Strategy Development 19 08-13-2008 03:09 PM
Condition Builder OUFan Strategy Development 6 12-19-2007 02:05 PM


All times are GMT -6. The time now is 08:18 AM.