Login Page - Create Account

Support Board


Date/Time: Thu, 25 Apr 2024 09:44:42 +0000



[Programming Help] - Calling my own dll to avoid double source code

View Count: 699

[2020-11-19 15:28:40]
gfx2trade - Posts: 48
Hi SC team,
I wrote a study using ASCIL that displays a colored bar based on a calculated number (capture1.jpg)
In another dll I would like to get the calcultated number calling this DLL.
I went through ACSIL Programming Concepts: Making Function Calls to External DLLs but I can't figure out on how to process.

My dll file is gfx_Studies_64.dll
In my trading system study, I could add the following line and compile
  // --------------------------------------------------------------------------
    HINSTANCE hInstLibrary = LoadLibrary("gfx_Studies_64.dll");
  // --------------------------------------------------------------------------

in gfx_Studies_64.dll I calculation is done in a specific study
SCSFExport scsf_EasyTrend(SCStudyInterfaceRef sc)
{

What code do I need to add in my trading system study in order to call scsf_EasyTrend and retreive the computed value ?

Also, is there any code to add to gfx_Studies_64.dll in order to allow external calls ?

Thks for your help.

B.

gfx
imageCapture1.JPG / V - Attached On 2020-11-19 15:23:55 UTC - Size: 41.15 KB - 257 views
[2020-11-20 15:40:23]
bradh - Posts: 854
If EasyTrend has a subgraph that outputs the number you want then you can use sc.GetStudyArrayUsingID.
[2020-11-20 17:39:05]
gfx2trade - Posts: 48
hi bradh,
thks. EasyTrend is not displayed on the chart.
I only did it to illustrate the issue.
B.
Gfx
[2020-11-20 17:52:01]
bradh - Posts: 854
EasyTrend is not displayed on the chart.

It doesn't have to be displayed, it could be hidden. If you are saying that EasyTrend is providing data to gfx_Studied.dll, does it use a subgraph?
[2020-11-22 16:04:50]
gfx2trade - Posts: 48
Hi, thks
Sorry for the confusion.
In fact, even hidden, it won't be attached to the chart.
What I meant is to be able into my trading system to write such a line ....
int myTrend = Call scsf_EasyTrend(sc)
and get as a result in myTrend the value calculated in the study gfx_Studies_64.dll
I hope it clarifies.
B.
gfx

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

Login

Login Page - Create Account