MultiCharts64 Version 9.0 Beta 2 (Build 9505)
I have found that when passing a data stream higher than data2 to a DLL function I (often) get an error from the MC charting application. If I attach from VS and step through at times no error is produced.
The error language is effectively "Message: Error in study "yourDLL (Contract / barperiod)".
Passing data1 (int 0), and data2 (int 1) work as expected and do not cause an issue.
Mark
Passing data stream > data2 causes error (DLL) [SOLVED]
-
- Posts: 55
- Joined: 10 Jul 2014
- Has thanked: 10 times
- Been thanked: 18 times
- Henry MultiСharts
- Posts: 9165
- Joined: 25 Aug 2011
- Has thanked: 1264 times
- Been thanked: 2957 times
Re: Passing data stream > data2 causes error (DLL)
Hello Mark,
Please send us the DLL, it's source code, PowerLanguage study and workspace you are using for replicating this behavior to support@multicharts.com
Please send us the DLL, it's source code, PowerLanguage study and workspace you are using for replicating this behavior to support@multicharts.com
-
- Posts: 55
- Joined: 10 Jul 2014
- Has thanked: 10 times
- Been thanked: 18 times
Re: Passing data stream > data2 causes error (DLL) [SOLVED]
In the event anyone happens to search this down, after significant testing it was identified that although each indicator passed to a DLL is given its own thread, strategies are aggregated per chart in order to handle the logic. The lesson here is that a DLL that works in a thread safe way on an indicator may not inherently also be safe on a strategy.
Initially I used thread local storage which suffices for indicators. If you are going to use DLL based analysis for strategies you may find you need to more atomically manage the context. Moving all objects to a Class working in the DLL that was causing this issue.
Initially I used thread local storage which suffices for indicators. If you are going to use DLL based analysis for strategies you may find you need to more atomically manage the context. Moving all objects to a Class working in the DLL that was causing this issue.