Thanks
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Disable Strategy after a certain date
Collapse
X
-
Hello mlarocco,
Are you printing the values used in the condition to confirm the condition is evaluating as true?
Are there labels in your prints to show what each value is?
Is there a print in the action block of the condition set to show the logic is being reached?
Are you calling SetState(Terminated), or CloseStrategy(), or are you calling return to prevent logic execution without disabling the script?
Are you printing the State to confirm the State has not changed?
Please provide the output from the prints saved to a text file and I will be happy to assist with analyzing the output.Chelsea B.NinjaTrader Customer Service
-
I'm really not getting that far. I thought I could use if (DateTime.Now < (some future date/time) but I can't get the syntax correct, it won't compile no matter what I tryOriginally posted by NinjaTrader_ChelseaB View PostHello mlarocco,
Are you printing the values used in the condition to confirm the condition is evaluating as true?
Are there labels in your prints to show what each value is?
Is there a print in the action block of the condition set to show the logic is being reached?
Are you calling SetState(Terminated), or CloseStrategy(), or are you calling return to prevent logic execution without disabling the script?
Are you printing the State to confirm the State has not changed?
Please provide the output from the prints saved to a text file and I will be happy to assist with analyzing the output.
Comment
-
I figured it out, this code works...Originally posted by NinjaTrader_ChelseaB View PostHello mlarocco,
If you are having a compile error you want assistance with, please provide the full error message and the line of code.
if (ToDay(Time[0]) > 20220608)
{
Print ("Strategy is Disabled");
CloseStrategy("Disable");
}
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by NullPointStrategies, Today, 05:17 AM
|
0 responses
50 views
0 likes
|
Last Post
|
||
|
Started by argusthome, 03-08-2026, 10:06 AM
|
0 responses
126 views
0 likes
|
Last Post
by argusthome
03-08-2026, 10:06 AM
|
||
|
Started by NabilKhattabi, 03-06-2026, 11:18 AM
|
0 responses
69 views
0 likes
|
Last Post
|
||
|
Started by Deep42, 03-06-2026, 12:28 AM
|
0 responses
42 views
0 likes
|
Last Post
by Deep42
03-06-2026, 12:28 AM
|
||
|
Started by TheRealMorford, 03-05-2026, 06:15 PM
|
0 responses
46 views
0 likes
|
Last Post
|

Comment