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 CarlTrading, 03-31-2026, 09:41 PM
|
1 response
153 views
1 like
|
Last Post
|
||
|
Started by CarlTrading, 04-01-2026, 02:41 AM
|
0 responses
89 views
1 like
|
Last Post
by CarlTrading
04-01-2026, 02:41 AM
|
||
|
Started by CaptainJack, 03-31-2026, 11:44 PM
|
0 responses
133 views
2 likes
|
Last Post
by CaptainJack
03-31-2026, 11:44 PM
|
||
|
Started by CarlTrading, 03-30-2026, 11:51 AM
|
0 responses
128 views
1 like
|
Last Post
by CarlTrading
03-30-2026, 11:51 AM
|
||
|
Started by CarlTrading, 03-30-2026, 11:48 AM
|
0 responses
107 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:48 AM
|

Comment