![]() |
|
|||||||
| 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 |
|
Member
|
Hi,
Today I cought Ninja when triggering on session beginning - I set "session begins" on 9:55AM, in that minute "out of nowhere" order was submited (see attachment). Others orders are fine but the first one. Simple strategy was used: buy/sell on SMA(3) and SMA(14) crossovers. So, the question is: why does it happen and how to avoid it in future? I am on NT 6.5.1000.7, XP Sp3. Best Regards |
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: May 2008
Location: Denver, CO
Posts: 3,157
Thanks: 0
Thanked 3 times in 3 posts
|
Hello,
This has do with strategy vs. account position. This link will help: http://www.ninjatrader-support2.com/...ead.php?t=4033 Also, go to Tools>Options>Strategies tab>NinjaScript tab, and check Wait until flat before executing live.
Ben
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Member
|
Hi Ben,
Thanks for quick reply. "Wait until flat before executing live" was checked. It always is. As I understood, every time I set "session begins" later than 9:30 and in the meantime condition was done (say simple Sma(3) crossbelow Sma(14), like it happend today), strategy position would be Long or Short (Short in my todays case). For me it should not trigger no matter what strategy position is, am I right? |
|
|
|
|
|
#4 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
|
The way it works is as follows Kowal.
You start your strategy at 9:30. Say you have a strategy position of 100 long. With "Wait until flat" you will continue to maintain this virtual position of 100L. Your account position should be flat. As data comes in and your strategy evaluates its trade conditions, when it finally reaches an exit order that brings you flat then you will make a live trade after that. These are the scenarios you may find yourself in: 1. ExitLong() triggered. Next trade = live 2. EnterShort() triggered. The close position part will be virtual, the obtaining of a short position will be live If you are experiencing differently please clarify.
Josh
NinjaTrader Customer Service |
|
|
|
|
|
#5 |
|
Member
|
Hi Josh,
thanks for reply - now I know a little bit more. Ok, so lets take a look at an attached chart from my first post. At 9:51 there is a crossover (Sma(3) below Sma(14)) - now, strategy position is short, profit trigger was set to 12 ticks so at 9:55 -when I want my strategy to start working - strategy position should be flat. There is no reason to trigger at that time. Or I am missing sth. |
|
|
|
|
|
#6 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
|
Let us take a step back. How are you starting your strategy?
Josh
NinjaTrader Customer Service |
|
|
|
|
|
#7 |
|
Member
|
Control Center/ Strategies/ New Strategy/
NQ, 1 Minute Session begins - 9:55AM Calculate on bar close - true Entries per directon - 1 Entry handling - AllEntries Stop&Target submission - PerEntryExecution |
|
|
|
|
|
#8 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
|
Please try the SampleMACrossOver strategy with "Wait until flat" selected in the same manner you are right now. If the SampleMACrossOver does not submit an order like the one you observed than we will need to dive into your strategy to see what is happening from that end.
Josh
NinjaTrader Customer Service |
|
|
|
|
|
#9 |
|
Member
|
Hi Josh,
I did few tests on Market Replay Data using SampleMACrossOver strategy with "Wait until flat" checked. Some "days" everything works like it should. Just beautifull. Some "days"...well, it doesnt. I attach some charts to illustrate what I mean. |
|
|
|
|
|
#10 |
|
NinjaTrader Customer Service
Join Date: May 2008
Location: Denver, CO
Posts: 3,157
Thanks: 0
Thanked 3 times in 3 posts
|
Hello,
What are the MA settings for the strategy? Are they the same as the SMA's you have on the chart in the screen shots? Can you provide the exact steps you are taking to produce this? Also, please post your replay data file.
Ben
NinjaTrader Customer Service |
|
|
|
|
|
#11 |
|
Member
|
Hi,
I used SampleMACrossOver strategy to "produce" these charts, SMAs settings are 10 and 25 (default) and yes, they are the same as SMAs in attached screen shots. I am not sure what You mean writing about exact steps. Strategy settings? Control Center/ Strategies tab/ New Strategy - here they are: (I would sent a screen shot, but I couldnt do that on PC, sorry) Strategy: SampleMACrossOver Parameters Fast: 10 Slow: 25 Data Series Instrument: ES 12-08 Type: Minute Value: 1 Time Frame Exclude weekend: False Session begins (local time): is on every screen shot Session ends (local time): 3:00PM General Account Sim101 Calculate on bar close: true Label: SampleMACrossOver Min. bars required: 20 HistoricalFillProcessing Fill type: Default Slippage: 0 Order Handling Entries per direction: 1 Entry handling: AllEntries Exit on close: True Exit on close seconds: 30 Stop & target submission: PerEntryExecution Order Properties Set order quantity: by strategy Time in force: Gtc I sent an email to subscriber-support at ninjatrader dot com, subject "data replay file - att BEN". |
|
|
|
|
|
#12 |
|
Member
|
Ups, she did that again.
SampleMACrossOver strategy Sessions begins (local time): 10:30AM |
|
|
|
|
|
#13 |
|
NinjaTrader Customer Service
Join Date: May 2008
Location: Denver, CO
Posts: 3,157
Thanks: 0
Thanked 3 times in 3 posts
|
Hello,
I will take a look at this when your email comes in with your data and get back to you with more information.
Ben
NinjaTrader Customer Service |
|
|
|
|
|
#14 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
|
Kowal,
We have not received your mail yet. If you don't mind could you try resending? Thank you.
Josh
NinjaTrader Customer Service |
|
|
|
|
|
#15 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
|
Kowal,
I know what is happening here. I suspect you are running on a 24hr chart. This means your indicators are running based off of the 24hr data set. When you change your strategy to start at 9:55AM you are now using a different data set. To see your trades you want to go to your chart properties and change the session begin/end time to correspond with your strategy's start/end time. In this manner you will be able to see correct data set and then match up your trades. If you are trying to use a time filter to limit trading instead you want to see this reference sample: http://www.ninjatrader-support2.com/...ead.php?t=3226
Josh
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Strange trades at the beginning of the session... | John833 | Charting | 19 | 12-01-2009 04:14 AM |
| Place Buy order and Sell order at same time. | robotics | General Programming | 38 | 08-07-2009 02:10 PM |
| How To Trigger A Sell Order From A Higher Price | b-rock | ATM Strategies (Discretionary Trading) | 2 | 07-24-2008 08:35 AM |
| sell order hanging - not getting closed | RK_trader | Miscellaneous Support | 8 | 07-19-2008 07:14 AM |
| feature request: set end and beginning of session for strategy as default | scriabinop23 | General Programming | 1 | 02-01-2008 05:34 AM |