![]() |
|
|||||||
| Strategy Development Support for the development of custom automated trading strategies using NinjaScript. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Senior Member
Join Date: Nov 2008
Posts: 576
Thanks: 0
Thanked 1 time in 1 post
|
Hi there,
I'm trading a multi-day strategy that looks at intraday bars. I have a SetStopLoss() set as part of my initialize(). However, I'd like to temporarily disable any stop losses during the first bar (30 minute bars) of each session... to avoid being taken out by any temporary gap downs. Do I need to fake it with a SetStopLoss(Price, 0); ...? I imagine there's a call out there that I can call to temporarily cancel any stop orders... |
|
|
|
|
|
#2 |
|
Administrator
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,164
Thanks: 6
Thanked 46 times in 32 posts
|
Hi,
There is no way to disable the submission of stops via the SetStopLoss() method. The only thing you could do is move them to a price far enough away from the market.
Ray
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Senior Member
Join Date: Nov 2008
Posts: 576
Thanks: 0
Thanked 1 time in 1 post
|
Ray,
I guess I'll have to do that. SetStopLoss() with a price at close to zero. I have a few followup questions. 1) What happens programatically if the order is rejected by the broker as being too far from the current price? What gets called in my application? 2) With other automated systems I've traded in the past, I've actually had issues with getting stop orders submitted at the beginning of the day. At 4 PM the previous day, the exchange cancels all day stop orders. And some brokers seem to cancel any newly submitted stop orders (for the open of market) overnight. Do you know how NinjaTrader handles stop orders for the first bar of the session? (If it matters, this would be with TDAmeritrade.) Are stop orders submitted GTC, so never canceled? If I modify the stop order's price at the close of session the previous day... what if it gets caught at 4:00 - 4:20 PM and never submitted? When would the exchange actually take action? Some of this I know I'll figure out as I actually deploy, but if anyone has expertise on how stop orders work in reality...that would be great. Again, my concern is effectively making sure my stop order will *not* be hit (under any condition) the first bar of the next session. |
|
|
|
|
|
#4 | |
|
Senior Member
Join Date: Nov 2008
Posts: 576
Thanks: 0
Thanked 1 time in 1 post
|
Quote:
http://www.ninjatrader-support2.com/...ead.php?t=5790 |
|
|
|
|
|
|
#5 |
|
Administrator
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,164
Thanks: 6
Thanked 46 times in 32 posts
|
We will reply on item #2 on Monday.
Ray
NinjaTrader Customer Service |
|
|
|
|
|
#6 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 107 times in 70 posts
|
2) When you run your strategy you have the option to choose what time in force setting you want to use for your orders. http://www.ninjatrader-support.com/H...meInForce.html
NinjaTrader handles all bars of the session. If you want something to happen on the first bar immediately I would recommend using CalculateOnBarClose = false. This way you can process at every single incoming tick. Also, if you have ExitOnClose set NinjaTrader will cancel your orders at the end of your trading session. http://www.ninjatrader-support.com/H...itOnClose.html
Josh
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| stop loss, trailing stop modification in NT6 | alfie | Strategy Development | 1 | 03-26-2008 03:46 PM |
| Create a parked STOP order with simple stop loss | skynetman | Strategy Development | 3 | 03-14-2008 12:36 AM |
| Disabling Snap to OHLC in one pane | Lost Trader | Indicator Development | 1 | 12-21-2007 05:02 PM |
| Order Entry Property: Use stop market for stop loss orders | higler | SuperDOM and other Order Entry Windows | 7 | 07-02-2007 09:06 AM |
| Stop Loss Orders activated by number of trades past stop level | DoveforUsAll | Suggestions And Feedback | 1 | 02-08-2006 01:19 AM |