Login Page - Create Account

Support Board


Date/Time: Thu, 28 Nov 2024 08:50:40 +0000



[User Discussion] - persistent variables: windows reboot fixed problem w/zero code changes?

View Count: 248

[2023-05-13 02:45:16]
User133994 - Posts: 80
Support,

Thanks for an amazing product.

I've been able to code up an automated strategy study and then control it from another study using persistent variables as shown in your example Trade Management Study code.

I also use custom structures and persistent pointers for these structures in the code.

Everything works great...until...it doesn't.

This is the first time I've seen this problem (in over 1.5+ years):

study a is an autotrade strategy that creates orders and saves ParentOrderID to persistent integers w/specific GetPersistentInt() calls (i.e. GetPersistentInt(301), GetPersistentInt(302)...)

study b is a target update study that also knows how to use GetPersistentInt(301...) [from study a] so that it can modify the order's target prices

These modifications were perfect--working fine. After adding 5 hours of coding updates (and no logic changes to the a-b trade management functionality) it just stopped working. Study (b) was supposed to update the orders from study (a) like it had been doing for over 1 year now. But, for some reason it just stopped.

I rolled back the code 5 hours to the original source w/o changes. And, it still didn't work!!? [ Of course, with every DLL update, I close SierraChart and copy the updated DLL into the data folder and re-open the chart with a & b on it, and ensure the I/O settings haven't been modified; if they have, I remove and re-add the custom studies. ]

I was totally confused as to why the a-b studies weren't working and finally in a last ditch effort, I rebooted windows. And....it worked? Wow. Really, 2 hours of debugging a problem that didn't exist!?, this is suspect.

So then I went forward 5 hours to my new source and recompiled...and whalla! It worked too.

Now I'm utterly confused why this behavior occurred as the source code was exactly the same when it worked and when it didn't work on 4 different occasions. THE ONLY difference was I re-booted windows (Note: I'm running windows in a virtual machine).

Is there some kind of persistent storage (or other?) that doesn't get cleared until windows reboots? I did many, many updates during that 5 hour timeframe and copied and re-copied DLLs and closed and opened Sierra Chart over 20x--and even when the I/O for the custom studies was modified, I had to re-add the custom study so the inputs would line up correctly. Even so, with a correctly compiled DLL the a-b study just "stopped" working and then after a reboot, started working again--with zero code changes.

During the 5 hours of coding, I did move the C++ code blocks around thus resulting in a different compiled location in the DLL file--which changed the *order* of the list of available custom studies from that DLL in the Sierra Chart interface--maybe that was it?

Please advise.

Thanks in advance
Date Time Of Last Edit: 2023-05-13 02:48:20

To post a message in this thread, you need to log in with your Sierra Chart account:

Login

Login Page - Create Account