Login Page - Create Account

Support Board


Date/Time: Sun, 24 Nov 2024 05:10:39 +0000



[Programming Help] - Problem with compiled custom study name always showing as - Custom DLL Study | CalcOrder -

View Count: 253

[2024-10-29 04:43:55]
User321619 - Posts: 26
After compilation of custom study cpp file, the study added to the list of studies always shows as "Custom DLL Study | CalcOrder". Even though SCDLLName and function name are completely different and modified multiple times, the name of study in the list remains same. Screenshots are attached.

Full description of problem: Everything has been working fine for couple of days as I was developing custom study. I was able to test and make changes numerous times and was almost done with the study. However, today a peculiar problem started. Once I compiled and added study to chart it showed up as name "Custom DLL Study | CalcOrder". Even though I do not have that name in my file. So, to eliminate any other problems, I created a small sample study with just couple of lines of code. It gives the same result. I also installed local cpp compiler and tried using that. Same results. I do not know what to do. Additionally, the study I was developing stopped showing inputs when the study was loaded on chart. So, something is definitely wrong.

Please advise.

(In image attached AddedStudy.png, the added study is #1)

Here is the code for sample study:

#include "sierrachart.h"

SCDLLName("Magic Study DLL")

//This is the basic framework of a study function.
SCSFExport scsf_AbraKaDabra(SCStudyInterfaceRef sc)
{
if (sc.SetDefaults)
{
//Code in this section
sc.SendOrdersToTradeService = 0;
sc.FreeDLL = 1;
sc.GraphName = "Autotrade";
sc.AutoLoop = 1; // Enable autoloop
return;
}
// Data processing code  
}

Date Time Of Last Edit: 2024-10-29 07:23:43
imageAddStudy.png / V - Attached On 2024-10-29 04:39:07 UTC - Size: 72.12 KB - 34 views
imageAddedStudy.png / V - Attached On 2024-10-29 04:39:12 UTC - Size: 67.57 KB - 28 views
imageCustomStudyOnChart.png / V - Attached On 2024-10-29 04:39:16 UTC - Size: 72.4 KB - 35 views
[2024-10-29 06:33:28]
User719512 - Posts: 263
Make sure you have the sc.GraphName set for those studies. Refer to the following:
ACSIL Interface Members - Variables and Arrays: sc.SetDefaults
[2024-10-29 06:52:00]
User321619 - Posts: 26
Thanks for your response. Yes, in actual study, GraphName and all other properties which are required are set correctly. It was working for couple of days and then it stopped. As of now it is doing the same with these 5 lines of code. I created this very basic study to make sure code is not the problem.
Date Time Of Last Edit: 2024-10-29 07:00:18
[2024-10-29 07:00:24]
User719512 - Posts: 263
Those 5 lines are missing required lines, so that's not helpful.

You might also ensure you're releasing dlls before building and allowing them to load after.
[2024-10-29 07:25:57]
User321619 - Posts: 26
Okay, added those few lines of code, just to make sure. Updated the code in original post. Yes, I did release dll before building and allow them to load. Still same results. I really need to get this fixed. Again, thanks for your response.
Date Time Of Last Edit: 2024-10-29 12:37:45
[2024-10-29 20:32:53]
User321619 - Posts: 26
SC Support and SC Engineering. Please help me solve this. As I cannot develop any custom study till this is fixed. I searched the forum and did not find anything about this bug.

Thanks
[2024-10-29 20:50:27]
ondafringe - Posts: 284
It's been a long time, but my ancient memory seems to recall whenever I saw the scsf_ prefix in the study list like you are showing, it indicated a corrupt DLL (or something was wrong with the DLL).

Just to check, you might try closing SC (or Releasing that particular DLL)... then go to the SC Data folder and delete that particular DLL... then restart SC (or Allow Load DLLs)... then rebuild the DLL and see if that helps.
Date Time Of Last Edit: 2024-10-29 21:14:10
[2024-10-29 22:19:50]
User321619 - Posts: 26
So many thanks ondafringe. Those sequence of steps followed exactly fixed the problem. I tried all of those before except deleting the dll. So, I believe that is what really fixed the problem, along with other steps.

Thanks for taking time to answer my question.

And thanks again, you really helped me.
[2024-10-29 22:57:09]
ondafringe - Posts: 284
You bet. Glad you got it worked out.
[2024-10-29 23:08:25]
User719512 - Posts: 263
Glad you got this sorted. Your original post said
I also installed local cpp compiler and tried using that.
which to me implied you successfully built a new dll (locally) and copied it over the old one which would imply a code issue, not a binary/dll copy/file issue.
[2024-10-30 04:30:57]
User321619 - Posts: 26
Ah, I see. So, I installed C++ components in Visual Studio which was already on my system. By installing that, it automatically populates the drop down in Analysis -> Build Custom Studies dialog box. The field "Visual C++ Path" drop down has this populated automatically to path of VC++ compiler. So, all I have to do is select menu Build -> Build with Visual C++. And it automatically places new dll in SierraChart\Data folder. You probably know all this but wanted to mention. So, still believe old dll was stuck and that is why I kept getting error.

Again, so many thanks for your help.

Cheers

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

Login

Login Page - Create Account