Login Page - Create Account

Support Board


Date/Time: Sat, 20 Apr 2024 03:06:14 +0000



Functions in ACSIL

View Count: 1697

[2018-10-26 15:22:47]
User470516 - Posts: 78
Dear SC Team,

I have spent several days now trying to create a function that has SCFloatRef as arguments and that returns a value. I am not asking for code support but for documentation, although if I cannot have it work on my own I'd like to use your paying services as I need to move on.

I have read former posts and your answers refer to this: C++ Functions : it is very clear and I have no problem writing functions provided they do not have arguments related to SC (i.e. int, float,...) but when I have to use SCSubgraphRef or SCFloatArrayRef, it just won't pass the compiler test and I do not understand why.

I therefore have tried to look for models and have thoroughly studied sc.MovingAverage and sc.GetLowest as examples. I have not been able to find the code. All the available studies call those functions and it is clear how to use sc.functions but I cannot use any "primary" function source codes as an example to help me because I simply cannot find them. I also have looked into the header files and I have found the declarations, but I am stuck.

1- Is it possible to have access to any code (the simplest the better) with SCarguments to pass and a returned value?

2- Would it be possible in case I cannot solve it on my own to buy a consulting service: I would provide you with a easy code (about 100 lignes) that works as a study that I would like to have someone turn into a function?

Thank you for your support.

Regards,

Laurent
[2018-10-26 17:57:19]
User470516 - Posts: 78
I meant SCFloatArrayRef. Sorry
[2018-10-26 18:29:34]
Sierra Chart Engineering - Posts: 104368
Do you still need help with this because this is marked as hidden? If you can attach the source code you are having a problem with we will have a quick look. You can privately attach that as a CPP file.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
[2018-10-29 13:13:53]
User470516 - Posts: 78
Dear SC Team,

1- I hid the post because I wrote I was considering to eventually buy a consulting service from SC and I was not sure you wanted that to go public.

2- Thank you very much for your answer and the help offer. I will not bother you with that this time because I eventually solved my problem when I ran into a huge piece of code provided by a gentlemen on the forum, I analysed it and realized I needed to declare my function as such:
void function(SCStudyInterfaceRef sc, ...). I would never have figured out this was required as I do not understand why. May I suggest you mention it here: Advanced Custom Study Interface and Language (ACSIL) may be with an example?

3- I have somme additional questions re. functions if they fall within the scope of your support:
3.1- The function I wrote is within a study where it is called from. I'd like it in a separate file. Should I write a .cpp file
containing the function code like I would for a study?
3.2- I have to create a 'myOwnStudy.h' file to declare the function and #include "myOwnStudy.h" in my studies that will call the
functions?
3.3- Would you have any example you can provide (moving average...)?

Once again, thank you for your support.

Regards,

Laurent
[2018-10-30 08:55:07]
Sierra Chart Engineering - Posts: 104368
2. The example you are looking for is already here:
ACSIL Programming Concepts: Passing ACSIL Interface Members Structure To Secondary Function

Should I write a .cpp file
containing the function code like I would for a study?
Yes.


3.2- I have to create a 'myOwnStudy.h' file to declare the function and #include "myOwnStudy.h" in my studies that will call the
functions?
Yes.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
[2023-01-27 12:19:03]
User538264 - Posts: 16
I eventually solved my problem when I ran into a huge piece of code provided by a gentlemen on the forum, I analysed it and realized I needed to declare my function as such:
void function(SCStudyInterfaceRef sc, ...). I would never have figured out this was required as I do not understand why. May I suggest you mention it here: Advanced Custom Study Interface and Language (ACSIL) may be with an example?

I am stuck at a similar problem where I need to define my own function for calculation.
Can you give me the source for the code you mentioned here? It'd be a huge help.

Thanks.

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

Login

Login Page - Create Account