![]() |
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 2011
Posts: 4
Thanks: 0
Thanked 0 times in 0 posts
|
Hi all,
I just tested this sample script: protected override void Initialize() { CalculateOnBarClose = true; } /// <summary> /// Called on each bar update event (incoming tick) /// </summary> protected override void OnBarUpdate() { // Condition set 1 if (Close[0] < Open[0]) { EnterLongLimit(GetCurrentBid()); } // Condition set 2 if (Close[0] > Open[0]) { EnterShortLimit(GetCurrentAsk()); } } NinjaTrader places no limit orders. If I use EnterLong() or EnterShort instead this sample script works. I used a ZenFire connection and the Sim101 account to test it. Why are no limit orders placed? There is no error in the log window and there are also buy and sell signals printed on the chart. Any ideas? Thank you! |
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: Dec 2011
Location: India
Posts: 3,286
Thanks: 580
Thanked 546 times in 541 posts
|
Hello amusche,
Welcome to the forum and I am happy to assist you. In the Control Center strategies tab, what is the color of the strategy? If it is yellow then the strategy is waiting until it reaches a flat position http://www.ninjatrader.com/support/h...egies_tab2.htm To submit the order unlock the strategy (if you are coding via the strategy wizard), and put this code below the OnBarUpdate Code:
protected override void OnBarUpdate()
{
if (Historical) return;
// rest of the code goes below.
Please let me know if I can assist you any further.
Joydeep M.
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Dec 2011
Posts: 4
Thanks: 0
Thanked 0 times in 0 posts
|
Hi
thank you for your quick answer. That was a good hint. It works now. |
|
|
|
|
|
#4 |
|
NinjaTrader Customer Service
Join Date: Dec 2011
Location: India
Posts: 3,286
Thanks: 580
Thanked 546 times in 541 posts
|
Hello amusche,
Glad to know the strategy is working fine. Please let me know if I can assist you any further.
Joydeep M.
NinjaTrader Customer Service |
|
|
|
|
|
#5 |
|
Junior Member
Join Date: Dec 2011
Posts: 4
Thanks: 0
Thanked 0 times in 0 posts
|
Yes, you can actually. I have some questions concerning the order filling simulation algo used for account Sim101.
How are limit orders assumed to be filled? Only if there is a tick above the limit (for sell) or below the limit price (for buy)? What is the impact of adjusting the delay properties (in the Simulator Tab under Options)? I am using a Zen-Fire datafeed on a colocated machine (equinix data center Chicago) to trade the mini S&P 500 future. I have about 1-2 msec delay to the order routing gateway. What is a reasonable value for Delay exchange? To what degree to you think a series of simulated limit orders is realistic or archeivable in real trading? That's a lot of questions but the answers would be very helpful for my further development projects. Thank you. |
|
|
|
|
|
#6 | |
|
NinjaTrader Customer Service
Join Date: Dec 2011
Location: India
Posts: 3,286
Thanks: 580
Thanked 546 times in 541 posts
|
Hello amusche,
In Sim, an buy limit order gets filled when the bid price goes below the buy limit price and in case of a sell limit order gets filled when the ask price goes above the sell limit price. The simulated orders try to replicate a real time environment. The delay is built in to simulate the lag/latency which we witness in RT while submitting orders. Please refer to the help files for detals: Quote:
Its difficult to say on our part to comment anything on the lag part. In Sim a buy order will get filled only when the bid price goes below buy limit price. In live trading you can get filled/part filled in bid price only. If your strategy is a low latency buy bid/sell ask type then it is difficult to replicate. Please let me know if I can assist you any further.
Joydeep M.
NinjaTrader Customer Service |
|
|
|
|
![]() |
| Tags |
| enterlonglimit, entershortlimit, limit orders |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| EnterLongLimit, EnterShortLimit not works | dalisdj | Suggestions And Feedback | 4 | 11-06-2011 03:12 PM |
| EnterLongLimit and EnterShortLimit fail | ipso33 | Automated Trading | 16 | 08-25-2011 04:43 PM |
| Can not place ATM on OCO Orders | aligator | ATM Strategies (Discretionary Trading) | 1 | 12-08-2010 11:46 AM |
| EnterShortLimit / EnterLongLimit | John833 | Strategy Development | 3 | 11-20-2008 04:39 PM |
| Place orders on current price. | Czarek | Strategy Development | 1 | 11-15-2008 02:24 PM |