What is the proper code to write comments to a file.
The following doesnt seem to write anything, but does create a file with the proper name in the proper location.
var f1; //used for the output file
var Log1;
function main()
{
today =new Date;
CurMonth =today.getMonth() +1;
CurDate =today.getDate() *1;
CurDay =today.getDay() *1;
// THE TRADE LOG
//var Log1;
// FILENAME WILL LOOK LIKE ES-MM-DD-2003.txt
Log1 = "ES-" + CurMonth + "-" + CurDate + "-2003.txt";
f1 = new File(Log1); // PUT IT IN FORMULA OUTPUT
f1.open("at+"); // I have no idea what this line does
*if(!f1.isOpen())
{
debugPrintln("*** Couldn't open TRADE LOG!");
}
else
{
debugPrintln("*** ES TRADE LOG OPEN");
}
// do a bunch of stuff here
//f1.writeln("ES SHORT REVERSAL, Cover");
// CLOSING THE LOG FILES
if(f1.isOpen())
{f1.close();}
return;
The following doesnt seem to write anything, but does create a file with the proper name in the proper location.
var f1; //used for the output file
var Log1;
function main()
{
today =new Date;
CurMonth =today.getMonth() +1;
CurDate =today.getDate() *1;
CurDay =today.getDay() *1;
// THE TRADE LOG
//var Log1;
// FILENAME WILL LOOK LIKE ES-MM-DD-2003.txt
Log1 = "ES-" + CurMonth + "-" + CurDate + "-2003.txt";
f1 = new File(Log1); // PUT IT IN FORMULA OUTPUT
f1.open("at+"); // I have no idea what this line does
*if(!f1.isOpen())
{
debugPrintln("*** Couldn't open TRADE LOG!");
}
else
{
debugPrintln("*** ES TRADE LOG OPEN");
}
// do a bunch of stuff here
//f1.writeln("ES SHORT REVERSAL, Cover");
// CLOSING THE LOG FILES
if(f1.isOpen())
{f1.close();}
return;
Comment