I have a chart showing SUN=N. For those that don't know, the =N is for data on the NYSE only. I am looking at the opening price (bar) for stocks on the NYSE only.
Here is the problem, sometimes the stock opens at 9:30 EST, sometimes it can take 10 minutes or longer before it officially opens on the NYSE. This causes a problem in my program beause there is no bar(s) until it opens. So I tell my program to open(0) at 9:30 AM and there is no bar it gives me this error message: "ReferenceError: getOpen is not defined"
I know this is easy for most of you but I have spent hours searching and can not find an asnwer. Any help would be appreciated.
My code (lines 19 an 27 cause the problems, highlighted with //******)
Here is the problem, sometimes the stock opens at 9:30 EST, sometimes it can take 10 minutes or longer before it officially opens on the NYSE. This causes a problem in my program beause there is no bar(s) until it opens. So I tell my program to open(0) at 9:30 AM and there is no bar it gives me this error message: "ReferenceError: getOpen is not defined"
I know this is easy for most of you but I have spent hours searching and can not find an asnwer. Any help would be appreciated.
My code (lines 19 an 27 cause the problems, highlighted with //******)
PHP Code:
debugClear()
function preMain() {
setPriceStudy(true);
setStudyTitle("Rick's First Hour");
}
var stockOpen = null;
function main() {
var ibarHour = getHour(0);
var ibarMinute = getMinute(0);
var ibarHrMin = ((getHour(0) * 100) + getMinute(0));
var ibarDay = getDay(0);
var ibarMonth = getMonth(0);
var ibarYear = getYear(0);
if (ibarHrMin >= 930 && ibarHrMin <= 935) {
if(getOpen(0) == undefined || getOpen(0) == null); return //******
stockOpen = getOpen(0);
MaxPrice = getOpen(0);
MinPrice = getOpen(0);
}
if (ibarHrMin >= 931 && ibarHrMin <= 1000) {
barTime = (getHour(0) * 100) + getMinute(0);
if(getOpen(0) == undefined || getOpen(0) == null); return //******
curPrice = getOpen(0);
if(curPrice > MaxPrice) {
MaxPrice = curPrice;
MaxPrice1 = curPrice - stockOpen;
}
if(open(0) < MinPrice) {
MinPrice = curPrice;
MinPrice1 = curPrice - stockOpen;
MinTime = barTime;
}
debugPrintln(ibarDay," Day= ",ibarMonth," Month= ",ibarYear," Year= ",stockOpen," stockOpen= ",MaxPrice1, "MaxPr= ");
}
}
Comment