NinjaTrader Support Forum  
X

Attention!

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


Go Back   NinjaTrader Support Forum > Application Technical Support > Automated Trading

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.

Reply
 
Thread Tools Display Modes
Old 09-01-2010, 12:37 AM   #1
Oil_Trader
Senior Member
 
Join Date: Aug 2010
Location: http://twitter.com/Oil_Trader
Posts: 141
Thanks: 0
Thanked 0 times in 0 posts
Default Simulation Fill on 15 minute bar

Let's say Bar[1] triggers a signal for a EnterLong

On Bar[0] which is a 15 minute bar (a lot of gyrations can happen in 15 minutes...how does the simulator fill my EnterLong order?

At the OPEN, HIGH, LOW, CLOSE?
does it fill it at the 1st Tick or 1st Minute of the 15 min Bar time series?
Oil_Trader is offline  
Reply With Quote
Old 09-01-2010, 02:18 AM   #2
NinjaTrader_Jason
NinjaTrader Customer Service
 
NinjaTrader_Jason's Avatar
 
Join Date: Aug 2007
Location: Breda, Netherlands
Posts: 11,223
Thanks: 83
Thanked 333 times in 325 posts
Default

Hello Oil_Trader,

It depends on what setting is used for 'Calculate on bar close'. If set to False, your strategy conditions will be calculated on each incoming tick. If set to True, conditions are calculated at the close of a bar. The order would be sent at the open of the next bar. More information can be found at the link below.
http://www.ninjatrader-support.com/H...BarClose1.html
NinjaTrader_Jason is offline  
Reply With Quote
Old 09-01-2010, 02:53 AM   #3
Oil_Trader
Senior Member
 
Join Date: Aug 2010
Location: http://twitter.com/Oil_Trader
Posts: 141
Thanks: 0
Thanked 0 times in 0 posts
Default

But for calculation of indicators? will it use the 15 minute bars? and not the tick bars?

What if there are no ticks, it is just 1 minute bars?

So only the orders that will apply to?
Oil_Trader is offline  
Reply With Quote
Old 09-01-2010, 03:11 AM   #4
NinjaTrader_Jason
NinjaTrader Customer Service
 
NinjaTrader_Jason's Avatar
 
Join Date: Aug 2007
Location: Breda, Netherlands
Posts: 11,223
Thanks: 83
Thanked 333 times in 325 posts
Default

It will use the bars on which you apply the indicator. If you apply the indicator in a 1 minute chart, the indicator will use 1 minute bars for calculations. If applied on a 150 tick chart, it will use 150 tick bars for its calculations.
NinjaTrader_Jason is offline  
Reply With Quote
Old 09-01-2010, 04:52 AM   #5
Oil_Trader
Senior Member
 
Join Date: Aug 2010
Location: http://twitter.com/Oil_Trader
Posts: 141
Thanks: 0
Thanked 0 times in 0 posts
Default

I made CalculateOnBarClose = false;

and it still calculates enter/exit position at the close of 15 minute bar.

I need it to CalculateOnBarOpen for the Entry/Exit.

is this possible?
Oil_Trader is offline  
Reply With Quote
Old 09-01-2010, 04:57 AM   #6
NinjaTrader_Jason
NinjaTrader Customer Service
 
NinjaTrader_Jason's Avatar
 
Join Date: Aug 2007
Location: Breda, Netherlands
Posts: 11,223
Thanks: 83
Thanked 333 times in 325 posts
Default

Can you please tell me how you tested your strategy. Did you test it on real-time data or did you test it on historical data only (Strategy Analyzer)?
NinjaTrader_Jason is offline  
Reply With Quote
Old 09-01-2010, 05:13 AM   #7
Oil_Trader
Senior Member
 
Join Date: Aug 2010
Location: http://twitter.com/Oil_Trader
Posts: 141
Thanks: 0
Thanked 0 times in 0 posts
Default

NT7 Simulator Mode for testing

The database has 1 minute data but the bars im using are 15 minute bars.
Oil_Trader is offline  
Reply With Quote
Old 09-01-2010, 05:23 AM   #8
NinjaTrader_Jason
NinjaTrader Customer Service
 
NinjaTrader_Jason's Avatar
 
Join Date: Aug 2007
Location: Breda, Netherlands
Posts: 11,223
Thanks: 83
Thanked 333 times in 325 posts
Default

Can you please check if 'Calculate on bar close' is set to False in the Strategy parameter window (the window that appears when you initiate a strategy) as well.

In addition, what happens if you test the SampleMACrossOver strategy with 'Calculate on bar close = False' in the same chart? Does it trigger orders only at the end of bars or intra-bar?
NinjaTrader_Jason is offline  
Reply With Quote
Old 09-01-2010, 05:53 AM   #9
Oil_Trader
Senior Member
 
Join Date: Aug 2010
Location: http://twitter.com/Oil_Trader
Posts: 141
Thanks: 0
Thanked 0 times in 0 posts
Default

Calculate on bar close' is set to False in the Strategy parameter window (the window that appears when you initiate a strategy) as well.

I dont see this on the parameter window?
Oil_Trader is offline  
Reply With Quote
Old 09-01-2010, 05:59 AM   #10
NinjaTrader_Jason
NinjaTrader Customer Service
 
NinjaTrader_Jason's Avatar
 
Join Date: Aug 2007
Location: Breda, Netherlands
Posts: 11,223
Thanks: 83
Thanked 333 times in 325 posts
Default

Do you see the option listed if you select the SampleMACrossOver strategy?

Does your custom strategy compile successful?
NinjaTrader_Jason is offline  
Reply With Quote
Old 09-01-2010, 06:03 AM   #11
Oil_Trader
Senior Member
 
Join Date: Aug 2010
Location: http://twitter.com/Oil_Trader
Posts: 141
Thanks: 0
Thanked 0 times in 0 posts
Default

Ok I see it but that's when you activate in on chart or control panel....not in the strategy analyzer...

where is it if i use the strategy analyzer?

yes my custom strategy is fine with the regular calculatebaronclose.
Last edited by Oil_Trader; 09-01-2010 at 06:06 AM.
Oil_Trader is offline  
Reply With Quote
Old 09-01-2010, 06:11 AM   #12
NinjaTrader_Jason
NinjaTrader Customer Service
 
NinjaTrader_Jason's Avatar
 
Join Date: Aug 2007
Location: Breda, Netherlands
Posts: 11,223
Thanks: 83
Thanked 333 times in 325 posts
Default

I see - the Strategy Analyzer will only use historical data. I assumed you ran the strategy on real-time data.

The 'Calculate on bar close' setting is disregarded - your conditions will be calculated at the close of each bar in the Strategy Analyzer. Unfortunately there is no way to change this.
NinjaTrader_Jason is offline  
Reply With Quote
Reply

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
Delay fill orders in Simulation Mode newbietrader ATM Strategies (Discretionary Trading) 1 08-30-2010 10:13 PM
Graphics future DAX 15 minute aguma Version 7 Beta General Questions & Bug Reports 14 06-16-2010 11:49 AM
range of selected 15 minute bars stephenszpak General Programming 11 06-28-2009 02:46 AM
limit order fill simulation andrewbee Strategy Development 4 03-11-2009 10:33 AM
Can 15-Minute Bar Backtest bars start on 7:20AM Session Start instead of 7:15 AM? ChiTrader2000 Strategy Development 5 01-30-2009 10:29 AM


All times are GMT -6. The time now is 07:35 AM.