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 > Suggestions and Feedback > Suggestions And Feedback

Suggestions And Feedback New feature suggestions and feedback.

Reply
 
Thread Tools Display Modes
Old 11-05-2011, 10:28 AM   #1
dalisdj
Member
 
Join Date: Oct 2011
Posts: 30
Thanks: 4
Thanked 1 time in 1 post
Default EnterLongLimit, EnterShortLimit not works

Hello,
I'm trying to write multi-time-frame strategy to backtest and got problem with EnterLongLimit / EnterShortLimit functions.

This strategy works with 2 time frames.
  1. 15 Minute period as primary
  2. 1 Day period as secondary
My strategy calculate at the first bar of every day the price to get long (from Day period bars) and set orders by calling EnterLongLimit( price ) and vice versa.

The problem is, that the order is executed immediately even if the price was not reached. This order is also executed by limit price and not by market price.

Hope I explain this issue clearly.
Thanks.
Attached Images
File Type: png EnterLongLimitProblem.PNG (259.0 KB, 13 views)
dalisdj is offline  
Reply With Quote
Old 11-05-2011, 09:46 PM   #2
NinjaTrader_Austin
NinjaTrader Customer Service
 
NinjaTrader_Austin's Avatar
 
Join Date: Jun 2009
Location: Denver, CO
Posts: 3,149
Thanks: 10
Thanked 89 times in 81 posts
Default

Hi dalisdj, can you please post your code so we can take a closer look?
NinjaTrader_Austin is offline  
Reply With Quote
Old 11-06-2011, 03:56 AM   #3
dalisdj
Member
 
Join Date: Oct 2011
Posts: 30
Thanks: 4
Thanked 1 time in 1 post
Default

Hi Austin,
here is your code. Btw I use 7.0.1000.7.
Attached Files
File Type: cs VolatilityBreakout.cs (2.3 KB, 17 views)
dalisdj is offline  
Reply With Quote
Old 11-06-2011, 01:34 PM   #4
NinjaTrader_Austin
NinjaTrader Customer Service
 
NinjaTrader_Austin's Avatar
 
Join Date: Jun 2009
Location: Denver, CO
Posts: 3,149
Thanks: 10
Thanked 89 times in 81 posts
Default

dslisdj, have you tried using stop orders yet? From the description you've provided earlier along with your code, it looks like you're trying to place two orders at a high and low price and wait until those prices are hit before the order fills. Your limit orders would be filled immediately because the long limit is higher than the current market price and vice-versa for the short limit order.

Please try with stop orders and let me know if you then get the expected behavior.
http://www.ninjatrader.com/support/h...erlongstop.htm
NinjaTrader_Austin is offline  
Reply With Quote
The following user says thank you to NinjaTrader_Austin for this post:
Old 11-06-2011, 03:12 PM   #5
dalisdj
Member
 
Join Date: Oct 2011
Posts: 30
Thanks: 4
Thanked 1 time in 1 post
Default

I see EnterLongLimit works differently than I expected. Changing to EnterLongStop make this code works according to my expectations.

Thank you very much for solving this problem Austin.
dalisdj is offline  
Reply With Quote
Reply

Tags
enterlonglimit, entershortlimit, problem

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
EnterLongLimit and EnterShortLimit fail ipso33 Automated Trading 16 08-25-2011 04:43 PM
Reverse using EnterShortLimit() monpere Strategy Development 12 03-16-2010 11:07 AM
EnterShortLimit question... dadof3and3 Automated Trading 5 07-06-2009 08:57 AM
EnterShortLimit / EnterLongLimit John833 Strategy Development 3 11-20-2008 04:39 PM
EnterShortLimit works great. How to offset "longs" ?! Imbah Strategy Analyzer 1 10-20-2008 01:35 PM


All times are GMT -6. The time now is 08:22 PM.