![]() |
|
|||||||
| Strategy Development Support for the development of custom automated trading strategies using NinjaScript. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 |
|
Junior Member
Join Date: Mar 2011
Posts: 10
Thanks: 0
Thanked 0 times in 0 posts
|
Hello,
I a strategy, defined a stoploss of 2% for short position in Initialize method Code:
SetStopLoss("Short",CalculationMode.Percent, 0.02, false);
![]() I attached screenshot of that trade Is someone could explain me why position was not cut around 2 % ? Thanks in advance |
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: Sep 2009
Location: Denver, CO
Posts: 8,117
Thanks: 249
Thanked 418 times in 415 posts
|
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
Ryan M
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Mar 2011
Posts: 10
Thanks: 0
Thanked 0 times in 0 posts
|
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! |
|
|
|
|
|
#4 |
|
NinjaTrader Customer Service
Join Date: Sep 2009
Location: Denver, CO
Posts: 8,117
Thanks: 249
Thanked 418 times in 415 posts
|
Glad to hear it's working the way you expect. Thanks for the follow- up here, LaughingDwarf.
Ryan M
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
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 |