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 07-06-2007, 05:53 AM   #1
Fabrice
Junior Member
 
Join Date: Jul 2007
Location: Russia
Posts: 7
Thanks: 0
Thanked 0 times in 0 posts
Default Catch the end of a minute bar on a tick by tick OnBarUpdate event

I was wondering if there is a way to catch the end of a minute bar when updating a strategy on a tick per tick basis?

I explain:

protectedoverridevoid Initialize()
{
....
Add(PeriodType.Minute,
1);

CalculateOnBarClose =
false;

}
Fabrice is offline  
Reply With Quote
Old 07-06-2007, 05:59 AM   #2
NinjaTrader_Dierk
Administrator
 
NinjaTrader_Dierk's Avatar
 
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 6 times in 6 posts
Default

No, since the end of the bar only would be determined as the first tick of the new bar was seen.

BTW: No need for
Add(PeriodType.Minute,1);
Just execute your strategy on a 1 minute series.
NinjaTrader_Dierk is offline  
Reply With Quote
Old 07-06-2007, 06:20 AM   #3
Fabrice
Junior Member
 
Join Date: Jul 2007
Location: Russia
Posts: 7
Thanks: 0
Thanked 0 times in 0 posts
Default

Quote:
Originally Posted by NinjaTrader_Dierk View Post
No, since the end of the bar only would be determined as the first tick of the new bar was seen.

Although, we are using tick to fire the OnBarUpdate event I thought there could have been a special event, a time event that could indicate the end of a bar even when there is not a new coming tick, something like:

OnBarUpdate.UpdateType = NewTick

or

OnBarUpdate.UpdateType = EndBarContext(ContextNumber)

Sometimes like this.

Basically it would be nice to have different types of events that could trigger the OnBarUpdate event and then be able to check the type of events which triggered the OnBarUpdate event.

It would be very helpfull to write fast accurate trading strategies.

BTW: No need for
Add(PeriodType.Minute,1);
Just execute your strategy on a 1 minute series.
I cannot do that as my strategies have limit orders but I want those orders to become market after a small time has passed or few quotations have occured. So I need to track down at the tick level my entry limit in the market to check if it was quoted or not.

Knowing the end of the bar of a given context before the first tick of the next bar would be handy to update my entry or exit trigger one tick earlier.

Thanks,
Fabrice.
Fabrice is offline  
Reply With Quote
Old 07-06-2007, 06:52 AM   #4
NinjaTrader_Dierk
Administrator
 
NinjaTrader_Dierk's Avatar
 
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 6 times in 6 posts
Default

Thanks for your suggestion. We'll add it to the list.
NinjaTrader_Dierk is offline  
Reply With Quote
Old 07-06-2007, 11:25 AM   #5
ceesvh
Member
 
Join Date: Jun 2007
Posts: 40
Thanks: 0
Thanked 0 times in 0 posts
Default

Fabrice,

Maybe is it possible to retrieve the time remaining from the indicator BarTimer. ( I do not know how to do it)
ceesvh is offline  
Reply With Quote
Old 07-06-2007, 12:28 PM   #6
NinjaTrader_Ray
Administrator
 
NinjaTrader_Ray's Avatar
 
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
Default

This is not possible.

Maybe PercentComplete would work?

http://www.ninjatrader-support.com/H...tComplete.html
NinjaTrader_Ray 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
Easiest way to check for last tick on a tick bar? higler General Programming 8 02-28-2009 02:01 PM
Woodie's Pivots different on minute and tick charts. laura Charting 11 09-06-2007 06:39 AM
Open tick to DOM deanldavis475 Connecting 3 06-22-2007 08:11 AM
nt open tick riccja Connecting 3 06-15-2007 12:18 PM
Tick counter gone? LG Charting 2 02-06-2007 07:31 AM


All times are GMT -6. The time now is 03:34 PM.