![]() |
|
|||||||
| Strategy Development Support for the development of custom automated trading strategies using NinjaScript. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 |
|
Junior Member
Join Date: Aug 2010
Posts: 4
Thanks: 0
Thanked 0 times in 0 posts
|
NT** A Sell stop order placed at '3/8/2004 4:00:00 PM' has been ignored since the stop price is greater than or equal to close price of the current bar. This is an
invalid order and subsequent orders may also be ignored. Please fix your strategy. The entry is at open. It is a big down day so the market closes below the ExitShortStop. How can I exit the same day as the entry? In real world if a stop order is penetrated the same day as the entry the exit is at the stop price. Does NinjaTrader not imitate real world trading when back-testing? |
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: Sep 2009
Location: Denver, CO
Posts: 8,117
Thanks: 249
Thanked 418 times in 415 posts
|
Hello,
Welcome to the NinjaTrader forums and thank you for your post! You will have to debug the price level for your stop order. Help for debugging your NinjaScript strategy is here: Debugging your NinjaScript Code You might consider other exit methods like ExitShort() which submit market orders when conditions are true. In backtesting, market orders are submitted at the open of the next bar following the condition. For more information on the discrepancies expected when backtesting versus real time, please see here: http://www.ninjatrader-support.com/H...sBacktest.html
Ryan M
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Aug 2010
Posts: 4
Thanks: 0
Thanked 0 times in 0 posts
|
Thanks for your suggestions. We did debug the above issue and used a different way to exit but still the same result.
if (dataValue.Low < (Positions[0].AvgPrice - dataValue.Atr * entrySwing.StopAtrMultiplier)) ExitLong(entrySwing.Name); For GE on 3/8/2004 the entry price is 32.50 the protective stop price is 32 and the close of the day is 31.83. Because the close is lower than the protective stop price NinjaTrader gives an error warning. Is there a way to get the NinjaTrader to recognize the day of the entry, such as MarketPosition, the same day as the entry, so that it will exit at the stop price the same day? So far we have tried ExitLong and ExitLongStop and neither of them exited on the same day as the entry. They both exited at the open the next day. |
|
|
|
|
|
#4 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,567
Thanks: 261
Thanked 1,017 times in 998 posts
|
You can't submit this stop order as it's not valid, before submitting you would need to check in your code that you actually prepare a legit order, a good practice is checking again the current inside market when submitting your stop orders.
Bertrand
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| "Entry/Exit at Open/close" on daily bars without an intrabar granularity | takeo | Suggestions And Feedback | 1 | 12-22-2009 08:01 AM |
| Entry date shows as the next day of actual entry | TintuLal | Strategy Analyzer | 6 | 09-25-2009 02:26 PM |
| Exit Position n bars since entry | MAX | Strategy Development | 5 | 09-08-2009 04:43 AM |
| Enter on bars, exit on ticks and min bars requirment | coolraz | Strategy Development | 3 | 12-15-2008 09:59 AM |
| Possible to enter/exit during the day with a daily strategy? | cunparis | Strategy Development | 2 | 11-01-2008 02:58 AM |