MC SDK question

Questions about MultiCharts and user contributed studies.
User avatar
danilo
Posts: 170
Joined: 02 Jan 2007
Location: Italy
Has thanked: 4 times
Been thanked: 9 times

MC SDK question

Postby danilo » 28 Apr 2007

I have written a little sample using the SDK and importing the PLKit.dll, but the following piece of code is not working yet:

/

Code: Select all

/////////////////////////////////////////////////////////////
// Calculate simple moving average value
__declspec( dllexport ) float f_GetAverage(IEasyLanguageObject * pELObj, int iAvgLength )
{
   float dMovAvg = 0 ;
   IEasyLanguagePricePtr price = pELObj->GetCloseMD(data1);
   // verify that sufficient bars have passed before back-referencing historical prices
   if( price->Getbarsback() > iAvgLength && iAvgLength > 0 )
   {
      float dSum = 0.0 ;
      for (int i = 1; i < iAvgLength; i++)
      {
         dSum += (float)price->GetAsDouble(i);
      }
      dMovAvg = dSum / iAvgLength;
   }
    return dMovAvg ;
}


the failure happen when I try to access to close value using the GetAsDouble(), do you have any suggestion ?

sparkz
Posts: 64
Joined: 16 Mar 2007

Postby sparkz » 28 Apr 2007

danilo, I haven't actually tried it myself yet (it's on my to do list).

Where did you get the "GetAsDouble" from? The original example uses "AsDouble". Have you tried the original text of the example?

User avatar
danilo
Posts: 170
Joined: 02 Jan 2007
Location: Italy
Has thanked: 4 times
Been thanked: 9 times

Postby danilo » 29 Apr 2007

danilo, I haven't actually tried it myself yet (it's on my to do list).

Where did you get the "GetAsDouble" from? The original example uses "AsDouble". Have you tried the original text of the example?


The PLKit.dll exposes some methods and properties, you can found them when the dll is imported in Visual Studio. I have tested the original example but whitout any success that's the reason why I have change a little the example.

jek
Posts: 164
Joined: 24 Dec 2006
Been thanked: 2 times

Postby jek » 29 May 2007

The PLKit.dll exposes some methods and properties, you can found them when the dll is imported in Visual Studio. I have tested the original example but whitout any success that's the reason why I have change a little the example.


Have you been able to find any documentation about user add-in functions?

I want to start calling some functions of my own but the site map gives nothing to get started. No documentation or even any statements about "look at TS documentation".

Suggestions?

User avatar
danilo
Posts: 170
Joined: 02 Jan 2007
Location: Italy
Has thanked: 4 times
Been thanked: 9 times

Beta 2.1

Postby danilo » 31 May 2007

I have tested the example with current 2.1 beta but is not working yet, any suggestions ?

sparkz
Posts: 64
Joined: 16 Mar 2007

Postby sparkz » 08 Jun 2007

I've been using a DLL recently to pass back and forth my own data with no trouble. I'm using Delphi btw. I have the other languages installed but I use Delphi mostly and I'm lazy!

I had a look at the IEasyLanguageObject and basic stuff works alright. Accessing Open, Close etc. It's only when I try a function which uses a data stream (eg. OpenMD), as in your example, that I have similar problems. They all just crash.

Is this a bug?

sparkz
Posts: 64
Joined: 16 Mar 2007

Postby sparkz » 08 Jun 2007

Can anyone get this to work on the new beta?

User avatar
Januson
Posts: 119
Joined: 18 Apr 2007
Location: Denmark

Postby Januson » 12 Jun 2007

Do anybody knows if it's possible to use C# instead of Delphi etc.?

sparkz
Posts: 64
Joined: 16 Mar 2007

Postby sparkz » 11 Jul 2007

In case there're any other programmers out there ponding over this.

After exchanging emails with the MC programmers it would appear that the historical aspect of the SDK dll interface doesn't work at present. That's accessing anything but the current bar. They assured me it would fixed in the "near future" which is good. At least they know about it now.

There are numerous ways of achieving the same end although they can use more memory. I just store the each bar as I go along so I can refer to historical bars from my own data.

Anyone else here dabbling with the SDK?

SP
Posts: 445
Joined: 06 Feb 2006
Has thanked: 36 times
Been thanked: 280 times

Postby SP » 12 Jul 2007

I have a similar problem. I use for one code the TS ELcollections and Global Var 2.2.
The code works since version 1.9 till 2.1.880.530. But with the latest Beta i get every time the message "Array bounce ..."

dupl
Posts: 158
Joined: 04 Jul 2007

Postby dupl » 05 Oct 2007

Hello,

I understand not really how it works this SDK for MC.

What do I have to do, if I want to programm a Data Source dll for MC, to receive data from a VB.NET application in MC?
I have built an realtime indicator in VB.NET and want now chart this realtime indicator in MC. I have a friend who can programm a dll, but I dont know how to go through to MC. How are the steps to programm a Data Source dll for MC?

Thanks

canny
Posts: 2
Joined: 20 Nov 2012

Re: MC SDK question

Postby canny » 20 Nov 2012

Hi danilo,
Have u fixed the ma dll?
can you give me a sample to do this in mc?
thx


Return to “MultiCharts”