Rank: Newbie
Groups: Registered, Registered Users Joined: 1/24/2006(UTC) Posts: 2
|
In the faq online it says "alerts can be written to a text file if you have developers kit"
Is there any suggestion on how to achieve this task via possibly MSX function calls ?
Looks like MSX is more like custom formula fuction calls, and MSFL is for reading the security price data . Any suggestions ?
Michael
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users Joined: 11/11/2005(UTC) Posts: 37
Was thanked: 1 time(s) in 1 post(s)
|
Hi Michael,
this is a simple C++ task and has nothing to do with MSX
incomplete Sample Code
...
LPSTR l_pszFileName = (LPSTR)(l_szFileName);
//create Output File
HANDLE hFile = CreateFile(l_pszFileName,GENERIC_WRITE,0,0,CREATE_ALWAYS,FILE_ATTRIBUTE_NORMAL,0);
// Output File is generated
if(hFile != INVALID_HANDLE_VALUE)
{
CloseHandle(hFile);
FILE *l_pszResultFile;
l_pszResultFile = fopen(l_pszFileName,"w+");
....
// Now you can add all information to the file, maybe something like this
char buffer[1000];
p = sprintf( buffer,"%s\\n", var1);
p += sprintf( buffer + p,"%s\\n", var2);
p += sprintf( buffer + p, "%5d", var3 );
// add your text to the file
fputs(buffer,l_pszResultFile);
....
// close the file
fclose(l_pszResultFile);
// if you like, you can open this file in Notepad with this call
ShellExecute(NULL, "open", "notepad.exe", l_pszFileName, NULL, SW_SHOW);
Ok? :D
|
|
|
|
Rank: Newbie
Groups: Registered, Registered Users Joined: 1/24/2006(UTC) Posts: 2
|
Hi Chris,
Thanks for your reply.
I guess I should re-ask the question little later after I reviewed and implemented the
code to see if there is any obstacle for not calling file functions from MSX.
At the same time, any suggestion for the topic from already implemented example will be appreciated.
thx,
Michael
|
|
|
|
Rank: Member
Groups: Registered, Registered Users Joined: 5/25/2006(UTC) Posts: 13 Location: Brisbane, Australia
|
Hi Chris,
I am in the process of writing a DLL that writes alerts to a SQL database. And by alerts I mean all of the information required in the security such as symbol, datetime bar, close, periodicity, interval, alert type (custom), alert value (custom). I am writing a VB.NET application to monitor this table and automate trades via a trading rules engine... this includes email/sms to key traders within our company.
Metastock has some 'less than efficient' features that make this a challenge, but Im almost there. If you want to do anything useful with the actual alerts I would suggest that you write to a database rather than text file as pulling data out of a database table is a lot friendler and faster than a text file.
Jeremy
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers Joined: 3/7/2005(UTC) Posts: 1,346
|
hey micheal...... not completely sure of your goal here..... if you consider email as text, metastock alerts themselves can send text, its an option on the alert....... the alerts 'texted' message can be sent to any email address..... text pagers also.....
again, not sure of your goal so those methods might be of no value to you...... the drawback is, multiple text messages will be sent if the alert bounces..... often they do.....h
|
|
|
|
Users browsing this topic |
Guest (Hidden)
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.