Dividend Files

Questions about MultiCharts and user contributed studies.
AMarsland
Posts: 19
Joined: 30 Sep 2010
Has thanked: 4 times
Been thanked: 1 time

Dividend Files

Postby AMarsland » 07 Oct 2015

Hi there,

How could I use Power Language to reference a text file in my Dropbox which contains a list of dates and dividend payments.

Yes, I could load as a separate ASCI file but would prefer to hold data out of the MC eco system and just read it when needed.

Many thanks,

Anthony

User avatar
Henry MultiСharts
Posts: 9121
Joined: 25 Aug 2011
Has thanked: 1258 times
Been thanked: 2927 times

Re: Dividend Files

Postby Henry MultiСharts » 07 Oct 2015

Hello Anthony,

Attached is a sample DLL with source files. Using the functions InData, OutData, RFile, SFile, ADDStringFile, DelFile, DirCreate this library can write to file, read from file, add a line to file, delete file, create folder.

Below is sample code for reading from the file:

Code: Select all

DefineDLLFunc: "C:\Users\root\Desktop\IOData\Release\IOData.dll", int, "RFile", lpstr;
DefineDLLFunc: "C:\Users\root\Desktop\IOData\Release\IOData.dll", lpstr, "InData", int;
var: idx(0), LinesCount(0);
once cleardebug;

if(LastBarOnChart_s) then begin
Print("What's in the file ?");
LinesCount = RFile("c:\\Temp\\11\\TS_Orders_Clean.txt");

for idx = 0 to LinesCount - 1 begin
print(InData(idx));
end;
end;
Attachments
IOData.zip
(27.4 MiB) Downloaded 169 times

AMarsland
Posts: 19
Joined: 30 Sep 2010
Has thanked: 4 times
Been thanked: 1 time

Re: Dividend Files

Postby AMarsland » 07 Oct 2015

Thanks Henry,

Can I access any of these functions directly from MC?

Anthony

User avatar
Henry MultiСharts
Posts: 9121
Joined: 25 Aug 2011
Has thanked: 1258 times
Been thanked: 2927 times

Re: Dividend Files

Postby Henry MultiСharts » 13 Oct 2015

Thanks Henry,

Can I access any of these functions directly from MC?

Anthony
AMarsland, you can use these functions only from the PowerLanguage code.

AMarsland
Posts: 19
Joined: 30 Sep 2010
Has thanked: 4 times
Been thanked: 1 time

Re: Dividend Files

Postby AMarsland » 13 Oct 2015

Sorry Henry didn't make myself clear...

Probably best if I just ask... How do I use this dll?

Thanks,

Anthony

User avatar
Henry MultiСharts
Posts: 9121
Joined: 25 Aug 2011
Has thanked: 1258 times
Been thanked: 2927 times

Re: Dividend Files

Postby Henry MultiСharts » 19 Oct 2015

Hello Anthony,

Please refer to the documentation to learn how to use it: DefineDLLFunc.

arjfca
Posts: 1283
Joined: 23 Nov 2010
Has thanked: 724 times
Been thanked: 222 times

Re: Dividend Files

Postby arjfca » 14 Dec 2015

Hello Anthony,

Attached is a sample DLL with source files. Using the functions InData, OutData, RFile, SFile, ADDStringFile, DelFile, DirCreate this library can write to file, read from file, add a line to file, delete file, create folder.

Below is sample code for reading from the file:

Code: Select all

DefineDLLFunc: "C:\Users\root\Desktop\IOData\Release\IOData.dll", int, "RFile", lpstr;
DefineDLLFunc: "C:\Users\root\Desktop\IOData\Release\IOData.dll", lpstr, "InData", int;
var: idx(0), LinesCount(0);
once cleardebug;

if(LastBarOnChart_s) then begin
Print("What's in the file ?");
LinesCount = RFile("c:\\Temp\\11\\TS_Orders_Clean.txt");

for idx = 0 to LinesCount - 1 begin
print(InData(idx));
end;
end;
Hello Henry

Amateur question:
Can I install. if so how do I install these dll from the zip file?

Martin


Return to “MultiCharts”