NinjaTrader Support Forum  
X

Attention!

This website will be down for maintenance from Friday May 24th at 6PM MDT until Sunday May 26th at 12PM 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 > General Programming

General Programming General NinjaScript programming questions.

Reply
 
Thread Tools Display Modes
Old 04-15-2012, 08:49 PM   #1
alvin050
Junior Member
 
Join Date: Sep 2009
Posts: 3
Thanks: 0
Thanked 0 times in 0 posts
Default Strategy to send orders immediately when it is Enabled

I am using Ninjatrader wizard to build new strategy, and want my strategy to send orders immediately when I press Enable in the Control Panel, and not wait for incoming tick to activate the strategy. How do I program this condition using the wizard? I use COBC=False and GetCurrentAsk()>GetCurrentBid() as my condition but it still waits for incoming tick to send orders.
Thank you for assistance
alvin050 is offline  
Reply With Quote
Old 04-16-2012, 02:18 AM   #2
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,421
Thanks: 252
Thanked 982 times in 964 posts
Default

alvin050, this would be unfortunately expected when working with your code in OnBarUpdate() - a tick has to be seen to trigger the logic, eventhough you're working with COBC = false. Please also keep in mind your GetCurrentAsk / GetCurrentBid properties only could work in realtime, for historical data they would use the close price.
NinjaTrader_Bertrand 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
Orders open and then close immediately reagardless forextrader2003 ATM Strategies (Discretionary Trading) 1 01-11-2012 03:04 PM
Stop Orders at Session Start which are immediately executable Joerg Version 7 Beta General Questions & Bug Reports 7 08-10-2010 07:48 AM
Orders Sent then Immediately Cancelled on Multi TF hodgsos Strategy Development 2 11-03-2009 11:51 AM
Why does my strategy send orders by itself? atrader Strategy Development 5 09-24-2009 02:33 PM
my limit orders immediately filled at market .? mini_me SuperDOM and other Order Entry Windows 6 05-31-2009 11:24 AM


All times are GMT -6. The time now is 12:28 AM.