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 05-28-2009, 04:53 AM   #1
JoeStein
Member
 
Join Date: Mar 2009
Posts: 35
Thanks: 0
Thanked 0 times in 0 posts
Default PendingSubmit orders and couple of scripting issues

1.I have two orders in PendingSubmit state. It's been around for a few days. Even after closing and restarting NT, the orders are still there. Please let me know how I could get rid of these, it slows down the process of bringing up data on the chart. (This is on NT Sim).

2.double entryPoint

I need to define a condition within my script that checks for:
if GetCurrentBid() “touches” entryPoint......//then do something

Is there any operator available to check for the above condition, other than
( if GetCurrentBid() == entryPoint ) ? I'm just concerned that if the market is moving too fast, then the == operator may not work.

3. Sometimes I need to Cancel an order and reuse the IOrder object as given below:
Code:
entryOrder = EnterLongStop(0, true, quantity, upperValue, "");
		
if ( (GetCurrentBid() - lowerValue) < 0.001 )
{
	CancelOrder(entryOrder);
	entryOrder = null;
	entryOrder = EnterShortStop(0, true, quantity, lowerValue, "");
}
Does the API provide for a more efficient way to do the above. I'm just concerned that if the order is not cancelled for some reason, then what would happen to my null assignment followed by EnterShortStop to the entryOrder object.

Thanks so much for the help.

Joe
JoeStein is offline  
Reply With Quote
Old 05-28-2009, 05:04 AM   #2
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,420
Thanks: 252
Thanked 981 times in 963 posts
Default

Hi JoeStein,

1. Please go to Tools > Options > Simulator > Misc and Reset the Simulator. Then the 'stuck' order should disappear.

2. Not sure I follow, if you fear you miss the entry point just use the script on CalculateOnBarClose = false - http://www.ninjatrader-support.com/H...BarClose1.html

3. Just check the OrderState for a cancel confirmation before reusing it - http://www.ninjatrader-support.com/H...V6/IOrder.html
NinjaTrader_Bertrand is online now  
Reply With Quote
Old 05-28-2009, 06:05 AM   #3
JoeStein
Member
 
Join Date: Mar 2009
Posts: 35
Thanks: 0
Thanked 0 times in 0 posts
Default

Thank you.
JoeStein 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
scripting dummy tradenoob Strategy Development 2 05-09-2009 07:45 AM
PendingSubmit, then nothing... CashCache Strategy Development 13 02-13-2008 11:10 AM
issues with stop limit orders woodside General Programming 4 02-12-2008 09:45 AM
A couple of programming questions... Goonior General Programming 3 01-04-2008 09:18 AM
Customised scripting for NT Antraman Indicator Development 2 01-12-2007 10:38 AM


All times are GMT -6. The time now is 08:11 AM.