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 CarlTrading, 05-11-2026, 05:56 AM
|
0 responses
65 views
0 likes
|
Last Post
by CarlTrading
05-11-2026, 05:56 AM
|
||
|
Started by CarlTrading, 05-10-2026, 08:12 PM
|
0 responses
40 views
0 likes
|
Last Post
by CarlTrading
05-10-2026, 08:12 PM
|
||
|
Started by Hwop38, 05-04-2026, 07:02 PM
|
0 responses
199 views
0 likes
|
Last Post
by Hwop38
05-04-2026, 07:02 PM
|
||
|
Started by CaptainJack, 04-24-2026, 11:07 PM
|
0 responses
366 views
0 likes
|
Last Post
by CaptainJack
04-24-2026, 11:07 PM
|
||
|
Started by Mindset, 04-21-2026, 06:46 AM
|
0 responses
283 views
0 likes
|
Last Post
by Mindset
04-21-2026, 06:46 AM
|

Comment