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)
I would look at your code and when it is executing and with what values before thinking there is an error in ACSIL. I think that assumption is incorrect.... from experience.
I noted the code logic works perfectly once In copy and paste the Dochian channel study code into the system.... So the main difference between working and non working version is the import of the study into subgraph .
I do it in replay --- I added a spreadsheet to figure out that the arrays are empty.
I searched sc.GetStudyArrayUsingID empty and there are many similar issues that the support doesn't answer clearly...
for example:
Ok this is probably my last post here for some time BUT,
Thats not true to what I have found with that function. I've showed you with the code I pasted on post #22 that its populating the correct values into the array from a linked study. I'm pretty sure you have an error somewhere. Maybe even the setting to the study like the screen shot?
Yes, there was calculation using the subgraph as in #22 but the performance of the study was not correct compared to another actual study that I coded in Spreadsheet..
Then, I did plot the variables L2_Buyer, L2_Seller to find that they are not correct as per the charts I sent earlier... I returned back and copy/paste the Donchian code within the code and it works as the spreadsheet....
So, I am revisiting the import into an array or even a subgraph but trying to do it such that the array is correct ... Subarray is empty --graph is not but incorrect...
No I have demand Index in the settings as ID2.SG1
Actually thinking about this you REALLY need to have this all in a separate study then just import the signal into your trading system.
This is almost certainly where your problem is. Get the study logic working in a separate function as you shouldn't have study logic in you trading system, makes it WAY too hard to debug as your result has shown. Pretty sure its not filling correctly because of its either pointing to an incorrect subgraph or a line of code somewhere in the spaghetti you posted at #16 is stopping a full run. (hopefully you are using Auto-Looping? because if no thats the problem)
I tried many iterations and the only one that works is copy paste the Dochian channel study code as part of the system before the trading logic ..
What is interesting is that the import of the demand index study is working but the Dochian channel subgraphs cannot be ported properly.
There is nothing wrong with the trading logic as it works just by forcing the code of the Dochian channel locally but the Get of its arrays is not working. I mean by it working that the array elements are not correct all the time....
I think the Get issue is a common topic among the support board and there was no clear response from Sierra support as usual.
I have not followed this in detail and have just a couple of simple thoughts.
1. Since this thead is about best practices, it is always a better practice to keep code compartmentalized in separate functions or classes, rather than putting it all together in one large one. This prevents unintended interactions within parts of the larger chunk of code, and everything I read (albeit I read it quickly) suggests that this was probably your problem. Even if it isn't in this instance, it will be, again and again, until you keep the parts of your code better separated.
I am not saying this as a critic. I am saying it as someone who had to learn the lesson again and again as I tried to track down my own mistakes. I understand the appeal of copy and pasting. It's also one of the most common ways to create unnecessary problems. I learned this too.
2. I remember reading a couple of times in this thread that you thought there was some error with the ACSIL framework itself, including in the quote above: "I think the Get issue is a common topic among the support board and there was no clear response from Sierra support as usual. "
When I was first starting out, a long time ago, I remember concluding that there was an error in the compiler of the language I was using. It turned out it was in my code. I will say, "of course." I come to that conclusions a few times after that, but since it never actually worked out that my code was rignt and the compiler was wrong, I got over this one too.
Again, I'm not being a critic. If I hadn't done this I would not have said anything.... and I am sure that everyone makes this mistake early on. But it's always been a mistake, at least when I did it.
With all this said, if you have gotten the code to work the way you wanted, congratulations. Working code is always better than neater, but non-working, code. But it you take @Trembling Hand's suggestions seriously, you will find writing and debugging to be a lot easier and faster.
Just some thoughts. I'm glad it is working now.
Bob.
When one door closes, another opens.
-- Cervantes, Don Quixote