NinjaTrader Support Forum  
X

Attention!

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


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 06-13-2007, 08:44 PM   #1
scjohn
Senior Member
 
Join Date: Dec 2004
Location: , ,
Posts: 224
Thanks: 0
Thanked 11 times in 8 posts
Default Stumped by error message

I get the following error message in the Log:
A SellShort stop order placed at '6/7/2007 11:02:00 AM' has been ignored since the stop price is greater than close price of the current bar. This is an inva

I bring up the data box and scroll to 6/07/2007 11:02:00 AM. the OHLC are 843.3/843.4/842.4/842.4.

Since that did not make any sense to me I added a Print() to show the Limit, Stop and Close price. Here is the code:
// Condition set 2
if (RunStrategy == 1
&& NTKPPowerPops(false, false, 8, false, 18, 9, true, 3, false).KPPowerPops[0] == -1)
{
Print(Time[0].ToString() + " Limit: " + Low[0] + " Stop: " + Low[0] + " Close: " + Close[0]);
EnterShortStopLimit(DefaultQuantity, Low[0], Low[0], "Entry Short");
}

The Output window shows:
06/7/2007 11:02:0 AM Limit: 842.4 Stop: 842.4 Close 842.4

To my way of thinking, the Stop Price is = to the Close, not greater.

I get a similar message when using EnterLongStopLimit() and the High and close of the bar are equal.
scjohn is offline  
Reply With Quote
Old 06-14-2007, 07:17 AM   #2
NinjaTrader_Ray
Administrator
 
NinjaTrader_Ray's Avatar
 
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
Default

We will change the error text to say that it is >= to the close price...
NinjaTrader_Ray is offline  
Reply With Quote
Old 06-17-2007, 02:32 PM   #3
scjohn
Senior Member
 
Join Date: Dec 2004
Location: , ,
Posts: 224
Thanks: 0
Thanked 11 times in 8 posts
Default

So it's impossible to Short StopLimit on the Low[0] and Long StopLimit on the High[0] because one never knows when the Low = Close or High = Close because of your = check of Stop price with the Close. This seems artificial to me as in real life one can do this.
scjohn is offline  
Reply With Quote
Old 06-17-2007, 07:46 PM   #4
NinjaTrader_Ray
Administrator
 
NinjaTrader_Ray's Avatar
 
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
Default

In real life, one can not submit a buy stop at a price <= current close. It will get rejected.

To reduce the chance that you do not get a rejected order in real-time and historical:

EnterLongStop(Close[0] == High[0] ? High[0] + TickSize : High[0]);
NinjaTrader_Ray 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
Unexpected error -104 message muthaf Automated Trading 8 05-08-2008 01:20 AM
Error Message 10001 nelson Miscellaneous Support 5 06-02-2007 07:34 PM
Error Message ardenb Installation and Licensing 4 04-11-2007 05:09 PM
What does this error message mean? funk101 Strategy Development 1 04-05-2007 02:42 AM
Interesting error message scjohn Automated Trading 2 03-02-2005 05:38 AM


All times are GMT -6. The time now is 09:35 AM.