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.

Reply
 
Thread Tools Display Modes
Old 03-14-2011, 03:23 PM   #1
LaughingDwarf
Junior Member
 
Join Date: Mar 2011
Posts: 10
Thanks: 0
Thanked 0 times in 0 posts
Question Strange StopLoss

Hello,

I a strategy, defined a stoploss of 2% for short position in Initialize method
Code:
SetStopLoss("Short",CalculationMode.Percent, 0.02, false);
This is working well except for one trade where stoploss is reached but the lost goes to 7% ...

I attached screenshot of that trade

Is someone could explain me why position was not cut around 2 % ?

Thanks in advance
Attached Images
File Type: png StopLoss.PNG (6.0 KB, 10 views)
LaughingDwarf is offline  
Reply With Quote
Old 03-14-2011, 04:03 PM   #2
NinjaTrader_RyanM
NinjaTrader Customer Service
 
NinjaTrader_RyanM's Avatar
 
Join Date: Sep 2009
Location: Denver, CO
Posts: 8,117
Thanks: 249
Thanked 418 times in 415 posts
Default

Hi LaughingDwarf,

It's not clear from the screenshot what should be happening. Your description says you are specifying a short position but the trade looks long.

For debugging your strategy, use plenty of Print() statements and TraceOrders output to track strategy order submission. Please see here for help using these debugging tools:
http://www.ninjatrader.com/support/f...ead.php?t=3418

There is a dedicated sample to exposing order details submitted with Set statements. You can see this sample here:
http://www.ninjatrader.com/support/f...ead.php?t=5790
NinjaTrader_RyanM is offline  
Reply With Quote
Old 03-15-2011, 11:24 AM   #3
LaughingDwarf
Junior Member
 
Join Date: Mar 2011
Posts: 10
Thanks: 0
Thanked 0 times in 0 posts
Default

Hi Ryan,
Thank you for pointing me that this is a long position and not a short one. And since i put in place a stop at 8% in case of long trade, then it means that stoploss are working perfectly.
Sorry not to have pay enough attention prior to posting this message.

Thank you!
LaughingDwarf is offline  
Reply With Quote
Old 03-15-2011, 11:35 AM   #4
NinjaTrader_RyanM
NinjaTrader Customer Service
 
NinjaTrader_RyanM's Avatar
 
Join Date: Sep 2009
Location: Denver, CO
Posts: 8,117
Thanks: 249
Thanked 418 times in 415 posts
Default

Glad to hear it's working the way you expect. Thanks for the follow- up here, LaughingDwarf.
NinjaTrader_RyanM 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
Strange error... molecool Strategy Development 11 07-10-2009 02:16 PM
Very Strange Bug r2kTrader Strategy Development 10 06-19-2009 11:34 AM
Strange connection Baruch Connecting 4 06-17-2009 05:36 AM
Strange and disturbing mainstream Strategy Analyzer 4 10-08-2008 05:32 AM
Strange effect Burga1 Strategy Development 5 05-16-2008 11:08 PM


All times are GMT -6. The time now is 09:59 PM.