![]() |
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
|
|||||||
| General Programming General NinjaScript programming questions. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Junior Member
Join Date: Feb 2008
Posts: 4
Thanks: 0
Thanked 0 times in 0 posts
|
protected override void OnBarUpdate()
{ IOrder orderBuy=null; IOrder orderSell= null; orderBuy = EnterLongStopLimit(Qty, 1, 1, "buy s1"); orderSell = EnterShortStopLimit(Qty, 1, 1, "sell s1"); } the orderSell will not be submitted.
Last edited by mike4398; 03-05-2008 at 04:54 AM.
|
|
|
|
|
|
#2 |
|
Administrator
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 6 times in 6 posts
|
That is correct. You can not have 2 entry order at both sides of the market at the same time.
Dierk
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Feb 2008
Posts: 4
Thanks: 0
Thanked 0 times in 0 posts
|
it doesn't give me any error messages, I have tried to use the limit orders instead and get incorrect results also.
How do I realize this: if the price goes up (to price1) I want long position triggered, if down (to price2) then enter a short position. the best way to achieve this is to place two orders in opposite directions since we dont know where the price is going to (the next bar) this is a standard situation and supported by most of the software and you say I cannot do that in NT? (!) If you go to Elitetrader, software section, all the software that I know does that. I feel the customers should be aware about this limitation. I looked up the help file and it doesn't say anything about this. When it should generate the error I guess instead of the weird results like execution outside high-low range I get yesterday.
Last edited by mike4398; 03-05-2008 at 04:50 AM.
|
|
|
|
|
|
#4 |
|
Junior Member
Join Date: Feb 2008
Posts: 4
Thanks: 0
Thanked 0 times in 0 posts
|
FYI, this is a second limitation of NT which I encountered while doing a simple test strategy, the first was that you cannot have multiple orders at the SAME direction and targetprofits working correctly!!!
Do the multiple orders at the same direction "throw off internal logic of a strategy" as well? So for example if you have SetprofitTarget 100 ticks and more than one order at the same direction the results will be incorrect. It doesnt give you error messages as well and it takes lots of time to figure out what the NT gives you completely wrong results. I think the order handling engine needs some serious development. |
|
|
|
|
|
#5 |
|
Administrator
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 6 times in 6 posts
|
You will see how NT internal order logic works as you turn TraceOrders on: http://www.ninjatrader-support.com/H...aceOrders.html
You always should should test your strategy to understand how the logic works. TraceOrders help you understanding the order details.
Dierk
NinjaTrader Customer Service |
|
|
|
|
|
#6 | |
|
Junior Member
Join Date: Feb 2008
Posts: 4
Thanks: 0
Thanked 0 times in 0 posts
|
Quote:
If the NT does not allow to have opposite orders, why would it take them without errors? The same for profit targets, any profit target exit with negative profit should generate at least some alert. It would be nice to have the alert (or assertion) when the code works not as expected because of "it's internal logic". If the program in computer have error it terminates, the strategy should do the same, just my opinion. I would prefer the strategy terminate itself other than running with errors.
Last edited by mike4398; 03-05-2008 at 08:20 AM.
|
|
|
|
|
|
|
#7 |
|
Administrator
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 6 times in 6 posts
|
Thanks for your suggestion. We'll add it to the list of future considerations.
Dierk
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| patsystems dont show historical! | Agamenon | Connecting | 2 | 01-08-2008 11:22 AM |
| Stop order submitted when employ strategy | maxpi | Strategy Development | 7 | 12-11-2007 08:19 AM |
| News dont lay out correctly | ofurbaldur | Miscellaneous Support | 4 | 08-16-2007 01:27 AM |
| Eurx charts dont' update until disconnect/reconnect | Futures_Shark | Charting | 3 | 07-03-2007 03:21 PM |
| Orders submitted | johncool | Miscellaneous Support | 1 | 01-19-2005 02:50 AM |