![]() |
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
|
|||||||
| Strategy Analyzer Support for automated system backtesting and optimization using the NinjaTrader Strategy Analyzer. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Senior Member
Join Date: Dec 2007
Location: Atlanta
Posts: 281
Thanks: 0
Thanked 4 times in 3 posts
|
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 |
|
|
|
|
|
#2 |
|
Administrator
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
|
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..
Ray
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
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 |