![]() |
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
|
|||||||
| Automated Trading Support for automated trading systems using NinjaScript. Support for our ATI (Automated Trading Interface) used to link an external application such as TradeStation and eSignal to NinjaTrader. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Junior Member
Join Date: Aug 2011
Posts: 5
Thanks: 0
Thanked 0 times in 0 posts
|
Hello.
In first time, sorry for my English level, itīs some bad. I have the next problem: in my strategy I enter on market with long position on day 16 bar. You can see the picture: ![]() EnterLong(DefaultQuantity, "Pos_Long"); stoplevel_alcista = Low[2]-filtro; EnterShortStop(DefaultQuantity,stoplevel_alcista," Pos_Short"); Long order is executed the previous day with BarOnClose active, so is executed on day 16 open at 46.26, itīs ok. Also, a stop reverse order is executed at same time at 44.56. I supose than stop order is not ejecuted at 16 day because both orders are evaluated at same time (Iīm not sure), but I didnīt understand why stop executes on bar 18 and not in bar 17. Could someone explains me where I mistaking? Thanks Regards, Andres |
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: Dec 2011
Location: India
Posts: 3,286
Thanks: 580
Thanked 546 times in 541 posts
|
Hello andriuking,
Welcome to the forum and I am happy to assist you. You have used Enter() method to place your stop order which will be rejected by the internal order handling rules. To place a stop please use the ExitLongStop method. Please refer to our help guide to know more http://www.ninjatrader.com/support/h...itlongstop.htm Also I would suggest to append the code TraceOrders = true, in the Initialize section of your code. This will provide you with the exact reasons for any internal order rejection. Please refer to this post for more debugging tips http://www.ninjatrader.com/support/f...ead.php?t=3418
Joydeep M.
NinjaTrader Customer Service |
|
|
|
|
|
#3 | |
|
Junior Member
Join Date: Aug 2011
Posts: 5
Thanks: 0
Thanked 0 times in 0 posts
|
Thanks Joydeep for your suport!
Quote:
I will check the information you provides me. Thanks |
|
|
|
|
|
|
#4 |
|
NinjaTrader Customer Service
Join Date: Apr 2010
Location: Denver, CO, USA
Posts: 4,783
Thanks: 160
Thanked 566 times in 557 posts
|
Please provide us with the TraceOrders output and we can help you determine exactly what is occurring and give you steps to resolve.
I look forward to assisting you further.
Matthew
NinjaTrader Customer Service |
|
|
|
|
|
#5 |
|
Junior Member
Join Date: Aug 2011
Posts: 5
Thanks: 0
Thanked 0 times in 0 posts
|
|
|
|
|
|
|
#6 |
|
NinjaTrader Customer Service
Join Date: Dec 2011
Location: India
Posts: 3,286
Thanks: 580
Thanked 546 times in 541 posts
|
Hello andriuking,
The internal order handling rules are rejecting the orders. To know exact reason please append the below code in the Initialize section of the code. Code:
TraceOrders = true; You can get the messages in the output window (In Control Center menu bar click on Tools>Output Window). Please provide us the TraceOrders output so that we can determine the exact reason for the order rejection.
Joydeep M.
NinjaTrader Customer Service |
|
|
|
|
|
#7 |
|
Junior Member
Join Date: Aug 2011
Posts: 5
Thanks: 0
Thanked 0 times in 0 posts
|
I only put until 26/01/2007 because is too long.
Appears that comment at 16, when orders dont execute: "**NT** A SellShort stop order placed at '16/01/2007 20:30:00' 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." 15/01/2007 20:30:00 Entered internal PlaceOrder() method at 15/01/2007 20:30:00: BarsInProgress=0 Action=Buy OrderType=Market Quantity=1 LimitPrice=0 StopPrice=0 SignalName='Pos_Long' FromEntrySignal='' 15/01/2007 20:30:00 Entered internal PlaceOrder() method at 15/01/2007 20:30:00: BarsInProgress=0 Action=Sell OrderType=Stop Quantity=1 LimitPrice=0 StopPrice=44,56 SignalName='' FromEntrySignal='' 15/01/2007 20:30:00 Ignored PlaceOrder() method: Action=Sell OrderType=Stop Quantity=1 LimitPrice=0 StopPrice=44,56 SignalName='' FromEntrySignal='' Reason='This was an exit order but no position exists to exit' 16/01/2007 20:30:00 Entered internal PlaceOrder() method at 16/01/2007 20:30:00: BarsInProgress=0 Action=SellShort OrderType=Stop Quantity=1 LimitPrice=0 StopPrice=44,56 SignalName='Pos_Short' FromEntrySignal='' **NT** A SellShort stop order placed at '16/01/2007 20:30:00' 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. 16/01/2007 20:30:00 Ignored PlaceOrder() method at 16/01/2007 20:30:00: Action=SellShort OrderType=Stop Quantity=1 LimitPrice=0 StopPrice=44,56 SignalName=Pos_Short' FromEntrySignal='' Reason='Invalid order price, please see log tab' 17/01/2007 20:30:00 Entered internal PlaceOrder() method at 17/01/2007 20:30:00: BarsInProgress=0 Action=SellShort OrderType=Stop Quantity=1 LimitPrice=0 StopPrice=44,56 SignalName='Pos_Short' FromEntrySignal='' 18/01/2007 20:30:00 Entered internal PlaceOrder() method at 18/01/2007 20:30:00: BarsInProgress=0 Action=Buy OrderType=Stop Quantity=1 LimitPrice=0 StopPrice=0 SignalName='Pos_Long' FromEntrySignal='' 18/01/2007 20:30:00 Ignored PlaceOrder() method at 18/01/2007 20:30:00: Action=Buy OrderType=Stop Quantity=1 LimitPrice=0 StopPrice=0 SignalName=Pos_Long' FromEntrySignal='' Reason='Invalid order price, please see log tab' 19/01/2007 20:30:00 Entered internal PlaceOrder() method at 19/01/2007 20:30:00: BarsInProgress=0 Action=Buy OrderType=Stop Quantity=1 LimitPrice=0 StopPrice=0 SignalName='Pos_Long' FromEntrySignal='' 19/01/2007 20:30:00 Ignored PlaceOrder() method at 19/01/2007 20:30:00: Action=Buy OrderType=Stop Quantity=1 LimitPrice=0 StopPrice=0 SignalName=Pos_Long' FromEntrySignal='' Reason='Invalid order price, please see log tab' 22/01/2007 20:30:00 Entered internal PlaceOrder() method at 22/01/2007 20:30:00: BarsInProgress=0 Action=Buy OrderType=Stop Quantity=1 LimitPrice=0 StopPrice=0 SignalName='Pos_Long' FromEntrySignal='' 22/01/2007 20:30:00 Ignored PlaceOrder() method at 22/01/2007 20:30:00: Action=Buy OrderType=Stop Quantity=1 LimitPrice=0 StopPrice=0 SignalName=Pos_Long' FromEntrySignal='' Reason='Invalid order price, please see log tab' 23/01/2007 20:30:00 Entered internal PlaceOrder() method at 23/01/2007 20:30:00: BarsInProgress=0 Action=Buy OrderType=Stop Quantity=1 LimitPrice=0 StopPrice=0 SignalName='Pos_Long' FromEntrySignal='' 23/01/2007 20:30:00 Ignored PlaceOrder() method at 23/01/2007 20:30:00: Action=Buy OrderType=Stop Quantity=1 LimitPrice=0 StopPrice=0 SignalName=Pos_Long' FromEntrySignal='' Reason='Invalid order price, please see log tab' 24/01/2007 20:30:00 Entered internal PlaceOrder() method at 24/01/2007 20:30:00: BarsInProgress=0 Action=Buy OrderType=Stop Quantity=1 LimitPrice=0 StopPrice=0 SignalName='Pos_Long' FromEntrySignal='' 24/01/2007 20:30:00 Ignored PlaceOrder() method at 24/01/2007 20:30:00: Action=Buy OrderType=Stop Quantity=1 LimitPrice=0 StopPrice=0 SignalName=Pos_Long' FromEntrySignal='' Reason='Invalid order price, please see log tab' 25/01/2007 20:30:00 Entered internal PlaceOrder() method at 25/01/2007 20:30:00: BarsInProgress=0 Action=Buy OrderType=Stop Quantity=1 LimitPrice=0 StopPrice=0 SignalName='Pos_Long' FromEntrySignal='' 25/01/2007 20:30:00 Ignored PlaceOrder() method at 25/01/2007 20:30:00: Action=Buy OrderType=Stop Quantity=1 LimitPrice=0 StopPrice=0 SignalName=Pos_Long' FromEntrySignal='' Reason='Invalid order price, please see log tab' 26/01/2007 20:30:00 Entered internal PlaceOrder() method at 26/01/2007 20:30:00: BarsInProgress=0 Action=Buy OrderType=Stop Quantity=1 LimitPrice=0 StopPrice=0 SignalName='Pos_Long' FromEntrySignal='' 26/01/2007 20:30:00 Ignored PlaceOrder() method at 26/01/2007 20:30:00: Action=Buy OrderType=Stop Quantity=1 LimitPrice=0 StopPrice=0 SignalName=Pos_Long' FromEntrySignal='' Reason='Invalid order price, please see log tab'
Last edited by andriuking; 08-22-2012 at 12:24 PM.
|
|
|
|
|
|
#8 | |
|
NinjaTrader Customer Service
Join Date: Dec 2011
Location: India
Posts: 3,286
Thanks: 580
Thanked 546 times in 541 posts
|
Hello andriuking,
Thanks for the information. A sell stop order must be equal or less than the last traded price. If not, the sell stop order will be rejected. Please edit your strategy and make sure the stop price is less than the last traded price. Quote:
Joydeep M.
NinjaTrader Customer Service |
|
|
|
|
|
|
#9 |
|
Junior Member
Join Date: Aug 2011
Posts: 5
Thanks: 0
Thanked 0 times in 0 posts
|
I understand now... So it executes at 18 bar (because the 17 bar closes over the order price) and donīt executes at 17 (because the 16 bar close below the order price).
Thanks very mucha for your help! |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Execute EntryOrder | Stephan123 | Strategy Development | 2 | 02-05-2012 04:44 PM |
| stop loss & profit target orders get activated only after buy stop order is execute | clearpicks | Automated Trading | 1 | 07-21-2010 06:18 AM |
| Version 6 does not execute | ts_gordo | Installation and Licensing | 12 | 08-25-2009 01:49 PM |
| can't get stop losses or profit targets to execute | leemiles | Strategy Development | 9 | 11-04-2008 08:56 AM |
| NT, why didn't this execute? | beauw | Automated Trading | 8 | 10-17-2008 08:14 AM |