I am trying to set a long or short value for an EFS variable to be used on an intraday chart.
Basically I want the variable to be true if the current price is above the yesterday's close.
I have tried dsgetValueAtTime to achive this but it unfortunately hangs the computer as it steps through all the chart data until it has loaded all the bars.
I have tried to work around this by using a 1 day 24 hour time template but for some reason I am getting a null value where I should be getting the close even though enough bars are loaded and the closing value I require is on the chart.
Any suggestions would be appreciated
Thanks
[ code]var myLib = addLibrary( "dsUtilities.efsLib" );
function preMain() {
setStudyTitle("Test");
setPriceStudy(true);
setShowCursorLabel(false);
}
function main(){
var nYestClose = myLib.dsgetValueAtTime( "16:00", 1, close() );
debugPrintln("nYestClose " +nYestClose);
} [/code ]
Basically I want the variable to be true if the current price is above the yesterday's close.
I have tried dsgetValueAtTime to achive this but it unfortunately hangs the computer as it steps through all the chart data until it has loaded all the bars.
I have tried to work around this by using a 1 day 24 hour time template but for some reason I am getting a null value where I should be getting the close even though enough bars are loaded and the closing value I require is on the chart.
Any suggestions would be appreciated
Thanks
[ code]var myLib = addLibrary( "dsUtilities.efsLib" );
function preMain() {
setStudyTitle("Test");
setPriceStudy(true);
setShowCursorLabel(false);
}
function main(){
var nYestClose = myLib.dsgetValueAtTime( "16:00", 1, close() );
debugPrintln("nYestClose " +nYestClose);
} [/code ]
Comment