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.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old 05-16-2011, 11:56 AM   #1
teak2
Junior Member
 
Join Date: May 2011
Posts: 17
Thanks: 0
Thanked 0 times in 0 posts
Default Adding To Position

I would like to know how to program a strategy that adds to a position every X pips as long as the entry conditions are still valid and then moves the stoploss up by the same amount each time a new position is added.

Example:

if(MA1 crosses MA2)
if(MA1 > MA2)
EnterLong(100000);

Then I would like to add another position at that 1st long entry plus 20 pips and move the trade1 stop up to breakeven. So now I am long 2 lots and have one stop at an initial value and another stop at breakeven. This can continue until the positions are either stopped out or the max number of positions has been reached.

This is asking a lot so any direction on where to start will be greatly appreciated. I am familiar with basic NinjaScript and have already written what I consider basic strategies.

Cheers!
teak2 is offline  
Reply With Quote
 

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
Adding a trailing stop to open position. billr Automated Trading 2 01-03-2011 10:17 AM
Adding to a Position? whoslooking Strategy Development 5 11-01-2010 12:27 PM
Adding to Position in Strategy / Analyzer webart Strategy Analyzer 2 04-14-2010 05:09 PM
Adding to a position YoungOne ATM Strategies (Discretionary Trading) 12 08-22-2009 03:02 PM
Adding to a position vandalrpm General Programming 2 04-09-2008 10:17 AM


All times are GMT -6. The time now is 03:10 AM.