I tried to use extension SDK of PL and was stuck in an error: Can't find function in .dll
My steps are as follows and hopefully could get some feedback.
1. The document http://www.TS.com/~/media/Fil ... on_SDK.pdf
2. Need to use "PLKit.dll" instead of "tskit.dll"
3. Need to check the version of your MC. 64bit can't read 32 bit .dll
4.
/* dll file */
Code: Select all
#include "stdafx.h"
#include <atlbase.h>
#import "C:\Users\Desktop\MC Util\PLKit.dll" no_namespace
double __stdcall MovAvg
(IEasyLanguageObject * pELObj, int iAvgLength)
{
double dMovAvg;
dMovAvg = 0;
// verify that sufficient bars have passed before back-referencing historical prices
if (pELObj->CloseMD[data1]->barsback > iAvgLength && iAvgLength > 0)
{
double dSum = 0.0;
for (int i = 0; i < iAvgLength; i++)
{
dSum += pELObj->CloseMD[data1]->AsDouble[i];
}
dMovAvg = dSum / iAvgLength;
}
return dMovAvg;
}
/* Easy Language Script */
Code: Select all
DEFINEDLLFUNC: "C:\Users\Desktop\MC Util\test2\x64\Debug\test2.dll",
double, "MovAvg", IEasyLanguageObject {self}, int;
inputs: Length(NumericSimple);
variables: int MyELVar( 0 ) ;
m_test = MovAvg( self, Length ) ;