Calling Python COM Server from Amibroker

I am using Amibroker version 6 and trying to call Python COM Server from Amibroker (AFL) using CreateObject function . However I am getting below error in Amibroker. Using Python 2.7 version.

“COM/object handle is null Formulas\Basic Charts\”

I am facing the same issue in Amibroker version 5.7 aswell.

Please let me know if I am required to use any plugin to enable the CreateObject function in Amibroker.

The AFL code I am using is copied below:

SetChartOptions(0,chartShowArrows | chartShowDates);
MyObj=CreateObject(“PyCoint”); // link to python com server

Title = “”;

symbol1 = ParamStr(“Symbol1”, “NIFTY-I”); //Enter Symbol1 can be control from External Parameters
symbol2 = ParamStr(“Symbol2”, “BANKNIFTY-I”);//Enter Symbol1 can be control from External Parameters
Color1 = ParamColor(“Color1”,colorGreen);
Color2 = ParamColor(“Color2”,coloryellow);

//Get the Foreign Price values

symC1 = Close;
RestorePriceArrays( True );

symC2 = Close;
RestorePriceArrays( True );

// COM object interface cannot deal with null value, set to zero to be sure

symC1 = Nz(symC1);
symC2 = Nz(symC2);

// use Cointegration method in com server to calculate smoothed value

coint = MyObj.COINT(symC1,symC2);

//Plot Correlation and CoIntegration in a Dashboard

GfxSetBkMode( 0 );
GfxSelectFont( “Tahoma”, 13, 100 );
GfxSetTextColor( colorWhite );

GfxSelectPen( colorGreen, 2 );
GfxSelectSolidBrush( colorgreen );
GfxRectangle( 10, 10, 200, 100 );

GfxTextOut( "Cointegration : " + NumToStr(coint,1.2,separator=false),13,13);
GfxTextOut( "Correlation : " + NumToStr(Correlation(symC1,SymC2,22)),13,43);



The message that you get means that CreateObject failed (was not able to create given object because it is either missing, not installed, the object name is incorrect, you don’t have access rights or whatever other reason).

Thanks for your reply. I tried giving admin rights to all applications and tested it, but got same error.
I am able to access Python COM sever object from Excel VBA script.
Please let me know if I am required to use any plugin to call Python COM Server from Amibroker or any other alternate way to call the object.

Nothing is required from AmiBroker side. AmIBroker has nothing to do with the problem you are having. You have misconfigured your Python install (“PyCoint” object can’t be created) but it is not Python help group and we don’t use Python here.