![]() |
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
|
|||||||
| Automated Trading Support for automated trading systems using NinjaScript. Support for our ATI (Automated Trading Interface) used to link an external application such as TradeStation and eSignal to NinjaTrader. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Junior Member
Join Date: Dec 2008
Posts: 13
Thanks: 0
Thanked 0 times in 0 posts
|
I have this code which is supposed to execute an order when the ema crosses the middle bollenger band && price action closes 2 ticks above the outer band (I also have it cross the outer band to make sure its coming from outside the bands).
Here is the code: (real tight bands) if (CrossAbove(EMA(Median, x), Bollinger(Median, 0.xx, xx).Lower, 1) && CrossAbove(EMA(Median, x), Bollinger(Median, 0.xx, xx).Middle, 1) && CrossAbove(Close, Bollinger(Median, 0.xx, xx).Upper, 1)) I think the last line should attempt to fill the order if the price action closes 2 ticks from the outer band. Two questions: 1. How make the last line close between to values, say 2 and 4 ticks... 2. I want the pending order to cancel if it is not filled within 3 bars or less. Any help with the code would be great? |
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,384
Thanks: 252
Thanked 967 times in 950 posts
|
TD-Trader747, I would suggest moving to the NinjaScript editor for this advanced order placement ideas, you could for example set the order to liveUntilCancelled and then CancelOrder it after 3 bars have elapsed with no fill. If you place limit orders they will be default expire on the next on bar update call, this link provides more detail - http://www.ninjatrader-support.com/H...verview36.html
Not sure on your first question, maybe you can clarify it - thanks!
Bertrand
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Waiting for execution | worow@yahoo.com | Automated Trading | 8 | 02-09-2009 03:54 PM |
| Multiple Time Bars & Limit Orders | NIKI01 | Automated Trading | 3 | 10-06-2008 07:15 AM |
| backtesting strategy with multiple bars does not run | j0dan | Strategy Development | 3 | 04-24-2008 08:56 AM |
| # bars back with multiple timeframes | palinuro | Market Analyzer | 1 | 04-03-2008 11:59 PM |
| multiple (unwanted) orders fired on 'outside' bars | roxana | Automated Trading | 1 | 05-25-2007 11:13 AM |