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 04-18-2008, 03:45 AM   #1
stefy
Senior Member
 
Join Date: Apr 2008
Posts: 310
Thanks: 0
Thanked 0 times in 0 posts
Default Profit Targets

Hi

I wrote a system and I'd like to apply a profit target, not a static one based on fixed nr of pips, but proportional to the ATR.

To do so, after my conditions to enter/exit trades, I wrote:

// Condition set 3
if (Close[0] > Position.AvgPrice * (1 + ATR(14)[0]))

{
ExitLong("TAKEPROFIT", " BUY");
}

It doesn't work though, like if those lines were not present, the system trades regardless.

What did I forget please?

Any help greatly appreciated
stefy 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
Simulated stops and profit targets. dtf139 ATM Strategies (Discretionary Trading) 3 03-11-2008 06:57 AM
Splitting Profit Targets fifty2aces Strategy Development 1 10-10-2007 08:00 AM
Profit Targets & 'Exit on Close' dgregor5 General Programming 2 07-15-2007 01:35 PM
Printing Current StopLoss & Profit Targets Jim-Boulder Strategy Analyzer 1 06-25-2007 11:16 AM
Profit Targets in Strategy Wizard gregw Strategy Development 3 01-24-2007 09:30 AM


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