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 03-24-2009, 03:32 AM   #1
ctrlbrk
Senior Member
 
Join Date: Oct 2008
Location: Dallas, TX
Posts: 682
Thanks: 0
Thanked 2 times in 2 posts
Default SetProfitTarget not working as expected

I normally deal with tick based strategies but wanted to try a new minute based strategy.

I want to avoid the "profit target on same bar as entry" pitfall.

In my strategy, I told it to enter a position and I did NOT set a profit target.

Then, I told it later that if BarsSinceEntry > 1, to go ahead and set a profit target.

My theory was this would prevent Ninja from entering and exiting on the same bar, since it doesn't know the OHLC order with minute data.

It doesn't work. Ninja seems to read the SetProfitTarget command and immediately identify it with a target starting from the entry point, instead of only looking for targets after the command was initiated.

I would like a work around or solution please.

Mike
ctrlbrk 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
SetStopLoss() not working as expected suedeuno Strategy Development 3 01-03-2009 09:16 AM
ExitLong()/ExitShort() not working as expected Tight Face Strategy Development 3 11-10-2008 09:27 AM
When in 2009 is NT7 expected? Re: Memory footprint bluelou Miscellaneous Support 11 06-22-2008 05:57 PM
DrawTextFixed not update as expected goover General Programming 2 03-04-2008 08:19 PM
SetProfitTarget() nolantx Automated Trading 1 02-08-2007 12:55 AM


All times are GMT -6. The time now is 12:05 PM.