I just thought about something: My condition statement will always be false because if Times[0][0].TimeOfDay <= new TimeSpan(08,30, 00) and if the time is 2300, then the condition will evaluate false because 2300 is greater than 0830, not less than 0830.
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Strategy not taking live trades but showing historical trades
Collapse
X
-
Hello Chelsea,
I just thought about something: My condition statement will always be false because if Times[0][0].TimeOfDay <= new TimeSpan(08,30, 00) and if the time is 2300, then the condition will evaluate false because 2300 is greater than 0830, not less than 0830.
-
Hello AdeptistJune,
Is this the test script I have provided you without being modified? Because this is not the condition or the print in the exported file I have posted?
Did you test the test script I have provided without modifying it?
With the condition in your last post, you are expecting a time that is greater than 17:00 and less than 8:30 at the same time? What time would be after 17:00 and before 8:30?Chelsea B.NinjaTrader Customer Service
Comment
-
Hello, Chelsea,
I did test the script you provided and it works perfectly for plotting RTH level. I'm just doing my best to calculate the overnight levels and use those plots during the RTH without any issues. When I an overnight trading hour template in an AddDataSeries, it will show historical trades only, but not take live trades because something about not being in session.Last edited by AdeptistJune; 12-27-2021, 08:48 AM.
Comment
-
Hello, Chelsea,
I can't believe I was overthinking that. The "Or" condition worked. I did learn how to use prints to check conditions, though. Thanks for toughing it out with me.
Comment
-
Hello, Chelsea,
Now the only problem I'm having is that the when I test a simple condition statement, "if during RTH, and the high cross above overnight high do something." For the oddest reason, the trade fires at 0830 no matter if the high crossed above the overnight high or not.
But I will use print statements to see if I can figure it out on my own.
- Likes 1
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by CarlTrading, 03-31-2026, 09:41 PM
|
1 response
80 views
1 like
|
Last Post
|
||
|
Started by CarlTrading, 04-01-2026, 02:41 AM
|
0 responses
40 views
0 likes
|
Last Post
by CarlTrading
04-01-2026, 02:41 AM
|
||
|
Started by CaptainJack, 03-31-2026, 11:44 PM
|
0 responses
63 views
2 likes
|
Last Post
by CaptainJack
03-31-2026, 11:44 PM
|
||
|
Started by CarlTrading, 03-30-2026, 11:51 AM
|
0 responses
63 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:51 AM
|
||
|
Started by CarlTrading, 03-30-2026, 11:48 AM
|
0 responses
54 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:48 AM
|

Comment