Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Current Contract
Collapse
X
-
Would you have any suggestiions then as to how I test the validity of a contract then? I have parameters which allow a user to specify the instrument and contract to be added to an indicator. If they type in an invalid contract the indi dies with a divide by zero error. I'm trying find a way to either test the parameter for a valid contract and/or capture the error so I can display an appropriate message to the user.
Comment
-
Hello,
No way to test the validity of the contract that I can think off.
About the only thing you can do is trap the error with c# using try() {} catch() {} blocks.
More information on using try catch blocks if your not familiur with them can be gound online.
Let me know if I can be of further assistance.BrettNinjaTrader Product Management
Comment
-
Can you give me an example of an incorrect entry for the parameter of Add() for the instrument that would cause the divide/0 error.
Also, do you have anything else in Initialize() other then the adds, if so please post them.
I look forward to assisting you further.BrettNinjaTrader Product Management
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by SalmaTrader, 07-07-2026, 10:26 PM
|
0 responses
35 views
0 likes
|
Last Post
by SalmaTrader
07-07-2026, 10:26 PM
|
||
|
Started by CarlTrading, 07-05-2026, 01:16 PM
|
0 responses
20 views
0 likes
|
Last Post
by CarlTrading
07-05-2026, 01:16 PM
|
||
|
Started by CaptainJack, 06-17-2026, 10:32 AM
|
0 responses
12 views
0 likes
|
Last Post
by CaptainJack
06-17-2026, 10:32 AM
|
||
|
Started by kinfxhk, 06-17-2026, 04:15 AM
|
0 responses
18 views
0 likes
|
Last Post
by kinfxhk
06-17-2026, 04:15 AM
|
||
|
Started by kinfxhk, 06-17-2026, 04:06 AM
|
0 responses
20 views
0 likes
|
Last Post
by kinfxhk
06-17-2026, 04:06 AM
|

Comment