Support Board
Date/Time: Tue, 26 Nov 2024 22:19:10 +0000
Post From: sc.SetChartStudyInputInt() reverts when used with sc.LastCallToFunction()
[2023-10-22 21:03:03] |
LudaTrades - Posts: 27 |
I appreciate you taking the time to look into this. The main thing I want to accomplish is to go in and turn the dials of a study, but be able to put them back when I leave. I don't want a user to accidently lose a study configuration they have put time into. I have another custom study that changes volume by price settings dynamically that shares this problem. Perhaps there is another solution to this that I'm not seeing? Currently I am saving the original settings when the study is first loaded, and then I'm setting it to initialized. The problem comes when the settings are modified and the user closes the chartbook with them still modified. If I'm not able to revert them before the chartbook is closed, when they next load the chartbook the study is still edited, and it gets initialized in the edited state. Likewise for when they remove the study through the studies window. The best I have currently come up with is instructions for the user: Backup chartbooks before loading my studies just in case, and set the study to hidden before removing it or closing the chartbook. This way I'm able to code in the reset on detecting if the study is hidden. It's not very elegant but I don't see an alternative. |