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 09-16-2008, 11:47 AM   #1
julen
Junior Member
 
Join Date: Sep 2008
Posts: 14
Thanks: 0
Thanked 0 times in 0 posts
Default ExitShortStop doesn't works

Hi... yes... It's me another time...

What you think is going wrong in this strategy? exitShortStop doesn't works, why?

///<summary>
/// Called on each bar update event (incoming tick)
///</summary>
protectedoverridevoid OnBarUpdate()
{
// Condition set 1
if (GetHighLowByTimeRange(10, 15, 9, 30).LowestLow[0] != GetHighLowByTimeRange(10, 15, 9, 30).LowestLow[1])
{
EnterShortStop(DefaultQuantity, GetHighLowByTimeRange(
10, 15, 9, 30).LowestLow[0] + -1 * TickSize, "");
}
// Condition set 2
if (Position.MarketPosition == MarketPosition.Short
&& BarsSinceEntry() >
1)
{
ExitShortStop((Position.AvgPrice) * (
1 + Stop), "", "");
}
}

Thanks a lot.
julen is offline  
Reply With Quote
Old 09-16-2008, 12:04 PM   #2
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 107 times in 70 posts
Default

For orders you feel that don't work the first step is to use TraceOrders = true along with Print() to determine if you are submitting valid stop prices. Please see these two articles: http://www.ninjatrader-support.com/v...ead.php?t=3418
http://www.ninjatrader-support.com/v...ead.php?t=3627
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
SetProfitTarget works incorrectly mike8943 Strategy Development 8 02-28-2008 03:25 PM
Program works on 6.0 not 6.5 123r34 General Programming 2 02-17-2008 07:36 AM
Indicator Works on one PC but not another nolantx Indicator Development 7 12-20-2007 12:12 PM
Does NT V6 works with Windows 2000? Paolo333 Installation and Licensing 3 05-07-2007 08:22 AM
Automated Trading Code no longer works werosen Automated Trading 3 06-15-2006 05:59 AM


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