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
Release control of draw objects
Collapse
X
-
Release control of draw objects
Is there a way to force and indicator to make its created objects user objects. Just as a simple example... Let's say I have an indicator that I use to draw some trend lines on a chart based on some captured mouse click locations. Currently, if I drop down a timeframe, all the analysis I would do gets wiped. Is there a way to force the indicator to keep them on the chart, or convert those objects to user-objects?Tags: None
-
Hello Antny,
Thank you for your note.
A solution would be to have your indicator write to a file, then upon reloading the chart this file would be ran and the drawing objects could be redrawn.
To do this you would need to use streamwriter,
Then stream reader,
Then you would need to design some logic for which to save to the file, either on each new drawing object or a loop before the time changes or at some regular interval.
Here would be an example of looping through drawing objects.
You could use a custom button to trigger the objects to be saved to the .txt file, here would be an example of creating a button,
Or a timer to trigger the saving of the objects, an example which uses a timer.
Please let us know if you need further assistance.Alan P.NinjaTrader Customer Service
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by cre8able, Today, 01:16 PM
|
1 response
3 views
0 likes
|
Last Post Today, 01:30 PM | ||
Started by chbruno, 04-24-2024, 04:10 PM
|
3 responses
47 views
0 likes
|
Last Post Today, 01:29 PM | ||
Started by samish18, Today, 01:01 PM
|
1 response
6 views
0 likes
|
Last Post Today, 01:25 PM | ||
Started by WHICKED, Today, 12:56 PM
|
1 response
8 views
0 likes
|
Last Post Today, 01:17 PM | ||
Started by WHICKED, Today, 12:45 PM
|
1 response
11 views
0 likes
|
Last Post Today, 01:08 PM |
Comment