Hello,
I am trying to export the current bar and a couple of bars back to a file. I have the following which does not seem to work. What am I doing wrong?
-Mike
var counter = 0;
var newDateObject = new Date(year, month, day);
function main()
{
var nBarIndex = getCurrentBarIndex();
var nBarState = getBarState();
var f = new File("newsymbol.txt");
f.open( "at" );
if(getBarStateInterval("d") == BARSTATE_NEWBAR)
{
counter = 0;
// debugPrintln("open=",close(0));
f.writeln(open(0)+",",high(0)+","+low(0)+","+close (0));
}
f.close();
}
I am trying to export the current bar and a couple of bars back to a file. I have the following which does not seem to work. What am I doing wrong?
-Mike
var counter = 0;
var newDateObject = new Date(year, month, day);
function main()
{
var nBarIndex = getCurrentBarIndex();
var nBarState = getBarState();
var f = new File("newsymbol.txt");
f.open( "at" );
if(getBarStateInterval("d") == BARSTATE_NEWBAR)
{
counter = 0;
// debugPrintln("open=",close(0));
f.writeln(open(0)+",",high(0)+","+low(0)+","+close (0));
}
f.close();
}
Comment