Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
Hi, I want to be able to create simple functions that I can use within the same DLL, so I have been studying arrays and have looked at other peoples' code, but I am still not understanding how to pull it all together.
As an example I would like to create a function for a ZLMA that I can reuse over and over again like so:
ZLMA(INPUTDATA, LENGTH)[sc.Index] or whatever the equivalent should be.
Then I would also like to be able to feed the function into itself, e.g. to calculate a double ZLMA, but whenever I have tried to feed other peoples functions into themselves, e.g. ZLMA(ZLMA(INPUTDATA, LENGTH), LENGTH), it looks like it creates some type of loop where on each bar it feeds the new calculation into the next resulting a super smoothed average that gets smoothed for as many times as there are bars on the chart so at the beginning of the chart I have a double ZLMA, but the next bar I have a triple ZLMA, etc.
Any help or references would be appreciated, thank you.
Can you help answer these questions from other members on NexusFi?
Thanks Cory, I have looked at that, but the moving average is a built-in system function. Correct me if I am wrong, but if it's not a built-in system function then there is other stuff you have to do to make it work. I am trying to simplify things by only accessing them from within the same DLL file and not creating a function call to be able to access it from a separate DLL file (I think that would be simplifying it anyway). Right now I have to duplicate each calculation, which I don't mind doing, except it is frequently resulting in too many subgraphs for the code to work. I know how to do it in Ninjascript, but the SC way is eluding me.
So I figured out how to build a function, if anyone ever needs help with it then feel free to message me.
I still can't run a function through another function though, the output is not correct. It over smooths the output and the problem is worse when longer periods are used. If anyone could help me with this I would appreciate it, thanks.
I have a new c#/c++ question. I am trying to convert this c# code to c++.
The second line won't compile in sierra. I am reading various tutorials about arrays, etc. but the examples are different and so I don't understand what newdouble[128]; means. Is it giving it an initial value of 128 or declaring an array of size 128 or something else? Thanks for any help.
Not sure what you want to do but it is a declaration of an array, but I do not think you initilise it.
Type Name elements - general formula.
So:
double value[128];
should be enough.
In the context of SC you can use Type SCSubgraphRef which will give you all properties of that type and you can output to a screen. cplusplus.com - The C++ Resources Network is a good site
Thanks