Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
time based stratagy on non time charts
Collapse
X
-
time based stratagy on non time charts
Is there any way to tell Ninja that you want to take a specific action, if the close of the current bar happens within a specified time frame, (in seconds or minutes), from the time the same bar opened? This is assuming that you are using a non time based chart like "range". I know what I want to do but don't know how to tell Ninja to do it. -
mjday,
You can use this calculated variable timeGap :
TimeSpan ts1 = Time[0] - new DateTime(1970,1,1,0,0,0);
TimeSpan ts2 = Time[1] - new DateTime(1970,1,1,0,0,0);
int timeGap=(int)ts1.TotalSeconds-(int)ts2.TotalSeconds;
..to calculate the elapsed time to complete last bar, and do whatever you want...
Regards,
Pablo Maglio
www.TheIndicatorStore.com
-
First let me thank you for the information.
Your post and expertise are way over my head. I have done some stuff with the strategy wizard thus far, but little to none with code.
If you can share any additional info to simplify your previous comments, that would be greatly appreciated by this automated strategy greenhorn.
Either way though, I intend to dig into this code thing in an effort not only to understand information like you sent, but also to hopefully get better at the strategy development thing.
Take care and thanks again for the help.
Michael
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by argusthome, Yesterday, 10:06 AM
|
0 responses
14 views
0 likes
|
Last Post
by argusthome
Yesterday, 10:06 AM
|
||
|
Started by NabilKhattabi, 03-06-2026, 11:18 AM
|
0 responses
11 views
0 likes
|
Last Post
|
||
|
Started by Deep42, 03-06-2026, 12:28 AM
|
0 responses
8 views
0 likes
|
Last Post
by Deep42
03-06-2026, 12:28 AM
|
||
|
Started by TheRealMorford, 03-05-2026, 06:15 PM
|
0 responses
4 views
0 likes
|
Last Post
|
||
|
Started by Mindset, 02-28-2026, 06:16 AM
|
0 responses
31 views
0 likes
|
Last Post
by Mindset
02-28-2026, 06:16 AM
|

Comment