Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Time as Indicator
Collapse
X
-
Time as Indicator
Is anyone aware of any way to use time only as an indicator? By this, I mean, to have a signal for action (i.e. enter buy or sell order at the bid or ask) strictly based on the time of day. For example, I want to submit a buy at the bid order at the market open at 9:30:00 exactlyTags: None
-
Hello Bdanels,
Thank you for your post.
You could use time as a signal to buy or sell in a similar way to the following reference sample:
The SampleTimeFilter strategy creates a time filter to only trade during certain times of the day, although you could implement this idea to enter a buy or sell order at the market open if you'd like:
Code:/* Checks to see if the time is during the busier hours (format is HHMMSS or HMMSS). Only allow trading if current time is during a busy period. The timezone used here is (GMT-05:00) EST. */ if ((ToTime(Time[0]) >= 93000 && ToTime(Time[0]) < 120000) || (ToTime(Time[0]) >= 140000 && ToTime(Time[0]) < 154500)) { // Entry Signal: If current close greater than previous close, enter long if (Close[0] > Close[1]) EnterLong(); }
If you are wanting to use this in an indicator rather than a strategy, you could still use the same time filters as conditions, then for the signal you could have the indicator draw an object on your chart. If you want to place orders from an indicator, you would need to utilize the Account class to subscribe to account related events and place orders:
Please let us know if we may be of further assistance.
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
558 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
324 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
101 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
545 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
547 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment