Thanks.
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
How to call time in ninjascript?
Collapse
X
-
How to call time in ninjascript?
How do I write "If time >= 0830 and time <= 1200" in ninjacript?
Thanks.Tags: None
-
Hello AdeptistJune,
Below is a link to forum post with helpful information about getting started with NinjaScript in NinjaTrader 7. I recommend the Strategy Wizard 301 video.Code:if (ToTIme(Time[0]) > 083000 && ToTime(Time[0]) <= 120000)
Chelsea B.NinjaTrader Customer Service
-
-
When I tried to compile the code, it says: The name "ToTime" does not exist in the current content.
What does this mean?
Comment
-
Hello AdeptistJune,
Below is a link to the help guide on ToTime(). It is a valid method for indicators and strategies.
https://ninjatrader.com/support/help...nt7/totime.htm
Did you add this within OnBarUpdate()?
Try using the strategy wizard to generate the condition.
May I have a screenshot of the error?
Chelsea B.NinjaTrader Customer Service
Comment
-
-
I created an indicator in Tradestation's easylanguage: Var:
HighLowRange(0),
BreakoutHigh(0), BreakoutLow(0),
HighestClose(0), LowestClose(0);
If time >= 0830 and time <= 1200 then
begin
BreakoutHigh = highest(high,15);
BreakoutLow = Lowest(low,15);
HighestClose = Highest(Close,15);
LowestClose = Lowest(Close,15);
end;
HighLowRange = BreakoutHigh - BreakoutLow;
plot14(Breakouthigh,"HourBreakoutHigh",blue);
plot15(BreakoutLow,"HourBreakoutLow",Red);
plot16(HighestClose,"HighestClose",magenta);
plot17(LowestClose,"LowestClose",Green);
I would like to create this same indicator in ninjascript.
Comment
-
-
I still can't get my code to compile. I set a screenshot of the error message.
Do you have any suggestions?
Comment
-
-
Emma,
You were correct about the correction in the script. Now, I'm receiving this error message.
Comment
-
I'm coding in NinjaScript 8. But do I declare it as a private or public var? And where do I declare it?
And thank you so much for helping me out. I only know to code in easylanguage. This is my first day with Ninja Trader.
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
607 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
353 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
560 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
561 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment