Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Ninja Trader clock
Collapse
X
-
Tags: None
-
Hello,
Thank you for your post.
This is expected as the bars in NinjaTrader are time stamped for when the bar will close.
For example with 1 minute bars as outlined in your screenshot it would be time stamped at 13:11 as this is when the bar closes and contains all the information from 13:10 to 13:10:59.
I have also included a link to our NinjaTrader Help Guide on bar timestamps:
Please let us know if we may be of any further assistance.
-
The problem arises when I have a time set for the order to be sent. the orders are being sent one minute before the time coded. Say if I have the condition like so: the orders were sent at 18:59.
Code:Calculate = Calculate.OnEachTick; TimeOfEntry = DateTime.Parse("19:00", System.Globalization.CultureInfo.InvariantCulture); TrailPeriod = 1; TimeofEntrylmt = DateTime.Parse("19:15", System.Globalization.CultureInfo.InvariantCulture); if ((CrossAbove(Close, Bollinger1.Upper, 1)) && (Times[0][0].TimeOfDay >= TimeOfEntry.TimeOfDay) && (Times[0][0].TimeOfDay < TimeofEntrylmt.TimeOfDay)) { EnterLong(10000, @"BBLE"); }Last edited by designer01; 03-10-2023, 06:12 PM.
Comment
-
Last edited by NinjaTrader_ChrisL; 03-13-2023, 02:49 PM.
Comment
-
Hello, I am running the strategy OnEachTick. So maybe I need to set the entry time at 19:01 so it does not send the order at 18:59?
The link provided is not working.
Comment
-
Hi, sorry I missed the OnEachTick setting you posted. Please confirm your conditions by using Print e.g.
if ((CrossAbove(Close, Bollinger1.Upper, 1))
&& (Times[0][0].TimeOfDay >= TimeOfEntry.TimeOfDay)
&& (Times[0][0].TimeOfDay < TimeofEntrylmt.TimeOfDay))
{
Print(Times[0][0].TimeOfDay);
Print(TimeOfEntry.TimeOfDay);
Print(TimeofEntrylmt.TimeOfDay);
EnterLong(10000, @"BBLE");
}
I fixed the link to the example in my post above as well.
Comment
-
Hi ChrisL thank you. I am running the strategy OnEachTick and offset 1 minute behind for the entry. Seems to work ok.
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by charlesugo_1, 05-26-2026, 05:03 PM
|
0 responses
66 views
0 likes
|
Last Post
by charlesugo_1
05-26-2026, 05:03 PM
|
||
|
Started by DannyP96, 05-18-2026, 02:38 PM
|
1 response
149 views
0 likes
|
Last Post
|
||
|
Started by CarlTrading, 05-11-2026, 05:56 AM
|
0 responses
162 views
0 likes
|
Last Post
by CarlTrading
05-11-2026, 05:56 AM
|
||
|
Started by CarlTrading, 05-10-2026, 08:12 PM
|
0 responses
99 views
0 likes
|
Last Post
by CarlTrading
05-10-2026, 08:12 PM
|
||
|
Started by Hwop38, 05-04-2026, 07:02 PM
|
0 responses
286 views
0 likes
|
Last Post
by Hwop38
05-04-2026, 07:02 PM
|

Comment