Will TraceOrders and Print commands in a strategy slow down a strategy's processing?
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
speed questions
Collapse
X
-
Use C# precompile directives
You should use C# precompile directives to compile in debug code when you are developling your strategies and to remove them from the compiled code when deploying your strategy for real time production use.
Example:
Add this to the first line of your strategy:
#define DEBUG
then around your Print() calls throuhg out your strategy wrap the Print and Trace calls with:
#if DEBUG
Print("Here is some debug output");
#endif
Then when your compiling for real time production use:
change the #define DEBUG at the top of your strategy to:
#undef DEBUG
Saves a lot of time having to comment and uncomment your debug code
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Hwop38, 05-04-2026, 07:02 PM
|
0 responses
164 views
0 likes
|
Last Post
by Hwop38
05-04-2026, 07:02 PM
|
||
|
Started by CaptainJack, 04-24-2026, 11:07 PM
|
0 responses
318 views
0 likes
|
Last Post
by CaptainJack
04-24-2026, 11:07 PM
|
||
|
Started by Mindset, 04-21-2026, 06:46 AM
|
0 responses
246 views
0 likes
|
Last Post
by Mindset
04-21-2026, 06:46 AM
|
||
|
Started by M4ndoo, 04-20-2026, 05:21 PM
|
0 responses
350 views
0 likes
|
Last Post
by M4ndoo
04-20-2026, 05:21 PM
|
||
|
Started by M4ndoo, 04-19-2026, 05:54 PM
|
0 responses
179 views
0 likes
|
Last Post
by M4ndoo
04-19-2026, 05:54 PM
|

Comment