Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
Partner 728x90
Collapse
NinjaTrader
On state change method error
Collapse
X
-
Hello efeuvejota01,
Thanks for your note.
It seems that you may have reposted the original script created by my colleague Chelsea located in the forum thread linked below.
That said, I see in the commented out code you posted that you are missing the use of a dispatcher for the UI in your script. This dispatcher is not missing from the attached file or the original indicator script.
Please see the original script in the forum thread linked above which demonstrates using a dispatcher in the script.
Also, see the help guide documentation below for more information about dispatchers.
Multi-threading Condisterations for NinjaScript: https://ninjatrader.com/support/help...sub=dispatcher
NinjaScript Best Practices: https://ninjatrader.com/support/help...sub=dispatcher
Let us know if we may assist further.
-
Hello, good morning:
I have the same error "Indicator 'SetIndicatorValueFromAddonWindowExample': Error on calling 'OnStateChange' method: The calling thread must be STA, because many UI components require this."
The indicator and the addon are a NT8 exampleshowing how to launch an an addon from an indicator, from a button on it.
I am trying to Launch the AddOn at the "OnstateChange" to apply it to my development which needs to launch the AddOn at early stages of an Indicator...
I just move the lines where the addon were launch from the button click to the transition stage
Code:else if (State == State.Transition) { // if (setIndicatorValueFromAddonWindowExampleToolsWindo w == null || setIndicatorValueFromAddonWindowExampleToolsWindow .IsVisible == false) // { Print("Before"); setIndicatorValueFromAddonWindowExampleToolsWindow = new AddOns.SampleAddOns.SetIndicatorValueFromAddonWind owExampleToolsWindow(); Print("after"); // { // // set an internal property of the addon to this indicator to send information back // TargetIndicator = this // }; // } // // open the window setIndicatorValueFromAddonWindowExampleToolsWindow .Show(); // // bring to the top setIndicatorValueFromAddonWindowExampleToolsWindow .Activate(); }
Thank you
Leave a comment:
-
Hello asmmbillah,
Thank you for your post.
So that we may accurately assist you, please provide the following information.- What is the name of the AddOn dll file?
- Where did you get the AddOn .dll file from?
- How are you setting up/calling the .dll file within your script?
Leave a comment:
-
On state change method error
Hi, my indicator shows the below error:
Error on calling "Onstatechange" method: The calling thread must be STA, because many UI components require this.
my indicator uses addon dll file. Can you please tell, why the above error may be showing?Tags: None
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by WHICKED, 03-27-2024, 12:33 PM
|
4 responses
41 views
0 likes
|
Last Post Today, 12:28 AM | ||
Started by f.saeidi, Today, 12:12 AM
|
0 responses
3 views
0 likes
|
Last Post
by f.saeidi
Today, 12:12 AM
|
||
Started by Conall, Today, 12:06 AM
|
0 responses
5 views
0 likes
|
Last Post
by Conall
Today, 12:06 AM
|
||
Started by proptradingshop, 03-21-2024, 09:50 AM
|
6 responses
27 views
0 likes
|
Last Post Today, 12:02 AM | ||
Started by mly916, Yesterday, 09:48 PM
|
1 response
12 views
0 likes
|
Last Post Yesterday, 11:54 PM |
Leave a comment: