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 Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
633 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
364 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
105 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
567 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
568 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment