Hello,
How do I change the file name in the code instead of the variable declaration?
Here is my code:
var f = new File( "newsymbol.txt" );
var counter = 0;
var newDateObject = new Date(year, month, day);
function main()
{
var nNumberBars;
var nBarIndex = getCurrentBarIndex();
var nBarState = getBarState();
nNumberBars = getNumBars();
if ((nBarIndex==0) && (nNumberBars != 0) )
{
f = sym + ".txt";
f.open( "wt" );
counter = 0;
while (counter != nNumberBars)
{
// debugPrintln("open2=",newDateObject);
f.writeln(getYear(counter)+ "/" + getMonth(counter) + "/" + getDay(counter)+","+open(counter).toFixed(4) +",",high(counter).toFixed(4)+","+low(counter).toF ixed(4)+","+close(counter).toFixed(4));
counter = counter - 1;
}
}
f.close;
return(0);
How do I change the file name in the code instead of the variable declaration?
Here is my code:
var f = new File( "newsymbol.txt" );
var counter = 0;
var newDateObject = new Date(year, month, day);
function main()
{
var nNumberBars;
var nBarIndex = getCurrentBarIndex();
var nBarState = getBarState();
nNumberBars = getNumBars();
if ((nBarIndex==0) && (nNumberBars != 0) )
{
f = sym + ".txt";
f.open( "wt" );
counter = 0;
while (counter != nNumberBars)
{
// debugPrintln("open2=",newDateObject);
f.writeln(getYear(counter)+ "/" + getMonth(counter) + "/" + getDay(counter)+","+open(counter).toFixed(4) +",",high(counter).toFixed(4)+","+low(counter).toF ixed(4)+","+close(counter).toFixed(4));
counter = counter - 1;
}
}
f.close;
return(0);
Comment