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 NullPointStrategies, Yesterday, 05:17 AM
|
0 responses
63 views
0 likes
|
Last Post
|
||
|
Started by argusthome, 03-08-2026, 10:06 AM
|
0 responses
139 views
0 likes
|
Last Post
by argusthome
03-08-2026, 10:06 AM
|
||
|
Started by NabilKhattabi, 03-06-2026, 11:18 AM
|
0 responses
75 views
0 likes
|
Last Post
|
||
|
Started by Deep42, 03-06-2026, 12:28 AM
|
0 responses
45 views
0 likes
|
Last Post
by Deep42
03-06-2026, 12:28 AM
|
||
|
Started by TheRealMorford, 03-05-2026, 06:15 PM
|
0 responses
50 views
0 likes
|
Last Post
|

Comment