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 > Application Technical Support > Strategy Analyzer

Strategy Analyzer Support for automated system backtesting and optimization using the NinjaTrader Strategy Analyzer.

Reply
 
Thread Tools Display Modes
Old 12-13-2007, 06:53 AM   #1
TAJTrades
Senior Member
 
Join Date: Dec 2007
Location: Atlanta
Posts: 281
Thanks: 0
Thanked 4 times in 3 posts
Default Limiting the number of Bars for Active Limit

I am suffering from a synapse meltdown!

I want to enter a Buy Limit order 4 ticks below the signal bar Close. ( Close[0] ). How can I cancel the order if not triggered within the next 3 bars.

I can even find documentation on this. Talk about a brain %$#@.

Thanks
TAJTrades is offline  
Reply With Quote
Old 12-13-2007, 07:19 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

By default, orders automatically cancel at the end of a bar therefore, you need to determine a way to *not* re-submit the order after three bars. One approach would be to create a private "int" variable outside the OnBarUpdate() method at the class level. Track the bar number the signal and order was placed (use CurrentBar) then track if the CurrentBar is greater than the bar number stored + 3 etc..
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
Number of Bars and Indicator Labels BlackJack Suggestions And Feedback 10 12-13-2011 07:07 AM
Limiting a Plot rt-trader General Programming 2 08-25-2007 06:21 PM
Limiting data in charts RedDuke Charting 5 05-14-2007 09:59 AM
display active stop / limit orders while running a strategy on a chart Nathamus Strategy Development 1 03-13-2007 07:22 AM
How to change the active account? fliesch Installation and Licensing 5 06-08-2006 12:16 AM


All times are GMT -6. The time now is 10:41 PM.