print to file in v8.8

Questions about MultiCharts and user contributed studies.
kernel
Posts: 91
Joined: 19 Feb 2013
Has thanked: 21 times
Been thanked: 4 times

print to file in v8.8

Postby kernel » 18 Dec 2015

Hi,

Is there any way to print to file in v8.8 and under win7?

I used to use print-to-file feature a lot back in older version and in winXP but unable to do so in v8.8 under win7.

Sometimes MC places orders during live market when conditions are not met, neither am I able to repeat it in replay mode. I am trying to print some info into a log file so I'll be able to look into it afterwards.

Thanks,

-Kernel

User avatar
JoshM
Posts: 2195
Joined: 20 May 2011
Location: The Netherlands
Has thanked: 1544 times
Been thanked: 1565 times
Contact:

Re: print to file in v8.8

Postby JoshM » 18 Dec 2015

Is there any way to print to file in v8.8 and under win7?
Yes, with FileAppend I suppose. At least, that works for me with v9.0 under Windows 7. Since this is an old keyword, it hasn't been introduced lately and so is also available under 8.8.
I used to use print-to-file feature a lot back in older version and in winXP but unable to do so in v8.8 under win7.
What kind of problems did you had? Perhaps they are solved in MC 9.1 now.

kernel
Posts: 91
Joined: 19 Feb 2013
Has thanked: 21 times
Been thanked: 4 times

Re: print to file in v8.8

Postby kernel » 18 Dec 2015

Hi Josh,

Just did a quick test with the following code, but nothing happened. According to its description, FileAppend is supposed to created the file if it's not already exist, however, it failed to do so.
I manually created a txt file, test1.txt, still, nothing gets written into it. any clue?

Like I said, sometimes MC places orders during live market when conditions are NOT met, neither am I able to repeat the problem in replay mode. I am trying to print some info into a log file when MC places orders during live market so I'll be able to look into it afterwards.

Code: Select all


[IntrabarOrderGeneration = TRUE]

for value1=0 to 10 begin
FileAppend("c:\test1.txt", numtostr(value1,0));
end;

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: print to file in v8.8

Postby TJ » 18 Dec 2015

make sure your file directory is not locked.

kernel
Posts: 91
Joined: 19 Feb 2013
Has thanked: 21 times
Been thanked: 4 times

Re: print to file in v8.8

Postby kernel » 19 Dec 2015

TJ,

The directory is not write protected. However, nothing gets written there. No file is created. If I manually created the test1.txt file, nothing gets written in it.

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: print to file in v8.8

Postby TJ » 19 Dec 2015

Hi Josh,

Just did a quick test with the following code, but nothing happened. According to its description, FileAppend is supposed to created the file if it's not already exist, however, it failed to do so.
I manually created a txt file, test1.txt, still, nothing gets written into it. any clue?

Like I said, sometimes MC places orders during live market when conditions are NOT met, neither am I able to repeat the problem in replay mode. I am trying to print some info into a log file when MC places orders during live market so I'll be able to look into it afterwards.

Code: Select all


[IntrabarOrderGeneration = TRUE]

for value1=0 to 10 begin
FileAppend("c:\test1.txt", numtostr(value1,0));
end;
You are writing to the root ?!?!?!

Try a subdirectory.

kernel
Posts: 91
Joined: 19 Feb 2013
Has thanked: 21 times
Been thanked: 4 times

Re: print to file in v8.8

Postby kernel » 19 Dec 2015

TJ,

Nothing changed with the following code. Also, the directory is NOT write protected.
Like I mentioned, it used to work properly with older MC versions and under WinXP.
With v8.8 and Win7, there are two variables involved here and not sure which causes the problem or simply something I missed?

Code: Select all

[IntrabarOrderGeneration = TRUE]

for value1=0 to 10 begin
FileAppend("E:\MClog\test1.txt", numtostr(value1,0));
end;

sptrader
Posts: 742
Joined: 09 Apr 2010
Location: Texas
Has thanked: 483 times
Been thanked: 274 times
Contact:

Re: print to file in v8.8

Postby sptrader » 19 Dec 2015

Try this one:

for value1 = 0 to 10 begin
FileAppend("c:\test1.txt", NumToStr(value1,0));
end;
Attachments
test1.txt
(21.38 KiB) Downloaded 559 times

kernel
Posts: 91
Joined: 19 Feb 2013
Has thanked: 21 times
Been thanked: 4 times

Re: print to file in v8.8

Postby kernel » 19 Dec 2015

sptrader,

Thanks for the reply. Just tried it with IOG off, but it didn't do the trick, no luck.
Try this one:

for value1 = 0 to 10 begin
FileAppend("c:\test1.txt", NumToStr(value1,0));
end;

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: print to file in v8.8

Postby TJ » 19 Dec 2015

sptrader,

Thanks for the reply. Just tried it with IOG off, but it didn't do the trick, no luck.
Try this one:

for value1 = 0 to 10 begin
FileAppend("c:\test1.txt", NumToStr(value1,0));
end;
Sounds like something in your operating system is stopping your MC to fileappend.

User avatar
JoshM
Posts: 2195
Joined: 20 May 2011
Location: The Netherlands
Has thanked: 1544 times
Been thanked: 1565 times
Contact:

Re: print to file in v8.8

Postby JoshM » 20 Dec 2015

Sounds like something in your operating system is stopping your MC to fileappend.
I think that too. Perhaps MultiCharts needs to be run as an administrator? Or a virus scanner that's a little bit to fanatic.

kernel
Posts: 91
Joined: 19 Feb 2013
Has thanked: 21 times
Been thanked: 4 times

Re: print to file in v8.8

Postby kernel » 20 Dec 2015

TJ and Josh,

Thank you both for your thoughts. I also suspected so but no clue has been found yet.

Per Josh's suggestion, I turned off virus scanner and ran MC as administrator but nothing changed.

I double checked the attribute of the target folder MC wrote to in Win7 setting, write permission was checked and granted....didn't help.

Anything else I overlooked?

User avatar
JoshM
Posts: 2195
Joined: 20 May 2011
Location: The Netherlands
Has thanked: 1544 times
Been thanked: 1565 times
Contact:

Re: print to file in v8.8

Postby JoshM » 20 Dec 2015

I double checked the attribute of the target folder MC wrote to in Win7 setting, write permission was checked and granted....didn't help.

Anything else I overlooked?
I would honestly don't know what else you might have overlooked; it seems you've checked everything already.

I have no trouble using the codes posted in this thread with MultiCharts64 Version 9.0 Release (Build 10014), and that's with a virus scanner running and MultiCharts in standard mode (no admin rights). So I suspect that I should have troubles with FileAppend() and not you.

The indicator:

Code: Select all

if (LastBarOnChart_s) then begin

for value1=0 to 10 begin
FileAppend("C:\temp\test1.txt", numtostr(value1,0));
end;

end;
Puts in the file:
012345678910
The strategy:

Code: Select all

[IntrabarOrderGeneration = true];

if (LastBarOnChart_s) then begin

for value1=0 to 10 begin
FileAppend("C:\temp\test2.txt", numtostr(value1,0));
end;

end;
Puts in the file:
012345678910012345678910012345678910012
345678910012345678910012345678910012345678910
012345678910012345678910012345678910012345678
910012345678910012345678910012345678910012345
678910012345678910012345678910012345678910012 etc
I think this is something for MultiCharts Support to solve; I don't know of other things we can try. Sorry.

kernel
Posts: 91
Joined: 19 Feb 2013
Has thanked: 21 times
Been thanked: 4 times

Re: print to file in v8.8

Postby kernel » 20 Dec 2015

Josh,

Thank you so much for your time and effort.

I still do not have clue what causes the problem, but at least I know what does NOT, based on your feedback...thank you.

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: print to file in v8.8

Postby Henry MultiСharts » 24 Dec 2015

Hello kernel,

Have you tried using Print command, instead of FileAppend?
Does Print successfully output into the PowerLanguage Editor Output tab?

kernel
Posts: 91
Joined: 19 Feb 2013
Has thanked: 21 times
Been thanked: 4 times

Re: print to file in v8.8

Postby kernel » 06 Jan 2016

Henry,

printing to output tab works fine.

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: print to file in v8.8

Postby Henry MultiСharts » 08 Jan 2016

Hello kernel,

Please come to our live chat Monday-Friday 6:30 am - 11 am EST to demonstrate this behavior remotely to our engineers.


Return to “MultiCharts”