Login Page - Create Account

Support Board


Date/Time: Sat, 28 Nov 2020 01:18:05 +0000



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

[2020-11-19 15:28:40]
gfx2trade - Posts: 47 | Ending Date: 2020-12-28
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 https://www.sierrachart.com/index.php?page=doc/ACSILProgrammingConcepts.html#DLLCalling 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 - 18 views
[2020-11-20 15:40:23]
bradh - Posts: 432 | Ending Date: 2020-12-09
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: 47 | Ending Date: 2020-12-28
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: 432 | Ending Date: 2020-12-09
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: 47 | Ending Date: 2020-12-28
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 login with your Sierra Chart account:

Login

Login Page - Create Account