can someone make this a paint bar (not a line ) ?
function preMain() {
setPriceStudy(true);
setStudyTitle("New Trading Day Marker");
setShowCursorLabel(false);
var fp = new Array(3);
fp[0] = new FunctionParameter("nHr", FunctionParameter.STRING);
fp[1] = new FunctionParameter("nMin", FunctionParameter.STRING);
fp[2] = new FunctionParameter("nSec", FunctionParameter.STRING);
for (j = 0; j < 3; ++j) {
for (i = 0; i < 60; ++i) {
var num = i+"";
if (i < 10) num = "0"+i;
if (i < 24 && j == 0) {
fp[j].addOption(num);
} else {
fp[j].addOption(num);
}
}
}
fp[0].setName("Set Hour");
fp[1].setName("Set Minute");
fp[2].setName("Set Second");
fp[0].setDefault("09");
fp[1].setDefault("30");
fp[2].setDefault("00");
}
var vHr = null;
var vMin = null;
var vSec = null;
var newDay = true;
var dayCntr = 0;
function main(nHr, nMin, nSec) {
var nState = getBarState();
var vInt = getInterval();
if (vInt == "D" || vInt == "W" || vInt == "M") return;
if (nState == BARSTATE_NEWBAR) {
if (newDay == false && getDay() != getDay(-1) && getDay(-1) != null) newDay = true;
if (newDay == true) {
var barHr = getHour()+"";
if (barHr != null && barHr < 10) barHr = "0"+barHr;
var barMin = getMinute()+"";
if (barMin != null && barMin < 10) barMin = "0"+barMin;
var barSec = getSecond()+"";
if (barSec != null && barSec < 10) barSec = "0"+barSec;
if(barHr >= nHr && barMin >= nMin && barSec >= nSec) {
drawLineRelative(0,0,0,99999,PS_SOLID, 1, Color.lightgrey, "NewDay"+dayCntr);
//drawShapeRelative(0, 5, Shape.DIAMOND, null, Color.blue,
//Shape.RELATIVETOBOTTOM, "NewDay"+dayCntr);
dayCntr += 1;
newDay = false;
}
}
}
return;
}
function preMain() {
setPriceStudy(true);
setStudyTitle("New Trading Day Marker");
setShowCursorLabel(false);
var fp = new Array(3);
fp[0] = new FunctionParameter("nHr", FunctionParameter.STRING);
fp[1] = new FunctionParameter("nMin", FunctionParameter.STRING);
fp[2] = new FunctionParameter("nSec", FunctionParameter.STRING);
for (j = 0; j < 3; ++j) {
for (i = 0; i < 60; ++i) {
var num = i+"";
if (i < 10) num = "0"+i;
if (i < 24 && j == 0) {
fp[j].addOption(num);
} else {
fp[j].addOption(num);
}
}
}
fp[0].setName("Set Hour");
fp[1].setName("Set Minute");
fp[2].setName("Set Second");
fp[0].setDefault("09");
fp[1].setDefault("30");
fp[2].setDefault("00");
}
var vHr = null;
var vMin = null;
var vSec = null;
var newDay = true;
var dayCntr = 0;
function main(nHr, nMin, nSec) {
var nState = getBarState();
var vInt = getInterval();
if (vInt == "D" || vInt == "W" || vInt == "M") return;
if (nState == BARSTATE_NEWBAR) {
if (newDay == false && getDay() != getDay(-1) && getDay(-1) != null) newDay = true;
if (newDay == true) {
var barHr = getHour()+"";
if (barHr != null && barHr < 10) barHr = "0"+barHr;
var barMin = getMinute()+"";
if (barMin != null && barMin < 10) barMin = "0"+barMin;
var barSec = getSecond()+"";
if (barSec != null && barSec < 10) barSec = "0"+barSec;
if(barHr >= nHr && barMin >= nMin && barSec >= nSec) {
drawLineRelative(0,0,0,99999,PS_SOLID, 1, Color.lightgrey, "NewDay"+dayCntr);
//drawShapeRelative(0, 5, Shape.DIAMOND, null, Color.blue,
//Shape.RELATIVETOBOTTOM, "NewDay"+dayCntr);
dayCntr += 1;
newDay = false;
}
}
}
return;
}
Comment