![]() |
|
|||||||
| Version 7 Beta General Questions & Bug Reports Ask questions here and post bug reports. |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Senior Member
Join Date: Feb 2010
Posts: 128
Thanks: 0
Thanked 0 times in 0 posts
|
Hi!,
I've this code: if (BarsInProgress == 0 ) { if (Position.MarketPosition != MarketPosition.Flat) { if (Position.MarketPosition == MarketPosition.Long) { ExitLong(1, contratos, "OutUp_f", "Up"); } if (Position.MarketPosition == MarketPosition.Short) { ExitShort(1, contratos, "OutDown_f", "Down"); } } if (Close[0] > Open[0]) orderlaunch = EnterShortStop(1, true, contratos, Low[0], "Down"); if (Close[0] < Open[0]) orderlaunch = EnterLongStop(1, true, contratos, High[0], "Up"); } ... next at BarsInProgress == 1 it's possible to get out if reaches some condition, if not, like you can see in the above code exits at beginning of the next Bar (BarsInProgress == 0). Ok, then the problem I've found (or perhaps is the expected behavior) is that if it closes at next bar (BarsInProgress == 0) and also in the same bar the stop price is reached never launches an order into the market. Is this correct? I've tried also setting EntriesPerDirection > 1 Thank you |
|
|
|
|
|
#2 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 107 times in 70 posts
|
joanNT,
To understand your orders I suggest you use TraceOrders = true so you can see if orders were ever submitted and if they were why they were ignored/rejected.
Josh
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Senior Member
Join Date: Feb 2010
Posts: 128
Thanks: 0
Thanked 0 times in 0 posts
|
Thanks Josh,
but I'm doing backtest and I can't see what happens with orders even with TraceOrders = True, cause the information in the output window is not enough, but I really think two orders in the same bar (one exit and one entry stop) it's not possible, which is your opinion? Do you ever saw this? or could be cause of backtesting? |
|
|
|
|
|
#4 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 107 times in 70 posts
|
Hard to say. You will need to use TraceOrders to determine the behavior you are truly seeing. If you want additional tracking you can add prints from OnOrderUpdate() and see the state changes of the orders too.
Josh
NinjaTrader Customer Service |
|
|
|
|
|
#5 |
|
Senior Member
Join Date: Feb 2010
Posts: 128
Thanks: 0
Thanked 0 times in 0 posts
|
Ok, I'll try tomorrow.
Thanks |
|
|
|
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| entry and exit within same bar | mayham | Strategy Analyzer | 7 | 11-02-2009 04:22 AM |
| Performance Object Entry & Exit Times | dbw451 | Strategy Development | 4 | 04-15-2009 02:59 PM |
| Entry/Exit Same Bar? | GreenTrade | Strategy Development | 3 | 01-12-2009 10:18 AM |
| Tracking orders from entry to exit | harri06665 | Strategy Development | 3 | 01-06-2009 07:09 AM |
| Entry and exit orders to the same bar | pragma | General Programming | 5 | 08-07-2008 04:56 PM |