Good Morning,
The following script is a cut up version of the timemarker from Alex. It draws lines on a tick chart but they do not stick like discussed in the Knowledge base. How do I make them stick relative to the time?
Best Regards,
Alan
/************************************************** *******
Draw time lines at 5 minute intervals
************************************************** ********/
function preMain() {
setPriceStudy(false);
setStudyTitle("Time Marker20Tnotime");
setCursorLabelName("Time");
setShowTitleParameters(false);
checkVersion(7.9,"http://share.esignal.com/ContentRoot/ACM%20Test/Formulas/Time Marker.efs","Time Marker.efs");
var fp1 = new FunctionParameter("Interval", FunctionParameter.NUMBER);
fp1.setLowerLimit(0);
fp1.setDefault(5);
var fp2 = new FunctionParameter("Offset", FunctionParameter.NUMBER);
fp2.setDefault(0);
var fp3 = new FunctionParameter("Lines", FunctionParameter.STRING);
fp3.addOption("On");
fp3.addOption("Off");
fp3.setDefault("On");
var fp3a = new FunctionParameter("Time", FunctionParameter.STRING);
fp3a.addOption("On");
fp3a.addOption("Off");
fp3a.setDefault("On");
var fp4 = new FunctionParameter("Cursor", FunctionParameter.STRING);
fp4.addOption("false");
fp4.addOption("true");
fp4.setDefault("true");
}
var Cntr = 0;
var x;
var y;
var z;
var w;
var pp;
function main(Interval,Offset,Lines,Time,Cursor){
setShowCursorLabel(eval(Cursor));
if(isDWM()==true){
setShowCursorLabel(false);
return;
}
if(getBarState()==BARSTATE_NEWBAR){
Cntr += 1;
}
x = (getHour()*1)+Offset;
y = getMinute()*1;
w = getSecond()*1;
if(x>=24) x = x-24;
if(x<0) x = 24+x;
if(x<5) x = "0"+x;
if(y<5) y = "0"+y;
z = x+":"+y+":"+w;
if(Lines=="On"){
if(Cntr == 1){
drawLineRelative(0,-30,0,99999,PS_SOLID, 1, Color.lightgrey,"Time"+Cntr);
pp = 1;
}
if(Cntr == (pp + 6)){
drawLineRelative(0,-30,0,99999,PS_SOLID, 1, Color.lightgrey,"Times"+Cntr);
pp = Cntr;
}
}
return z+"";
}
The following script is a cut up version of the timemarker from Alex. It draws lines on a tick chart but they do not stick like discussed in the Knowledge base. How do I make them stick relative to the time?
Best Regards,
Alan
/************************************************** *******
Draw time lines at 5 minute intervals
************************************************** ********/
function preMain() {
setPriceStudy(false);
setStudyTitle("Time Marker20Tnotime");
setCursorLabelName("Time");
setShowTitleParameters(false);
checkVersion(7.9,"http://share.esignal.com/ContentRoot/ACM%20Test/Formulas/Time Marker.efs","Time Marker.efs");
var fp1 = new FunctionParameter("Interval", FunctionParameter.NUMBER);
fp1.setLowerLimit(0);
fp1.setDefault(5);
var fp2 = new FunctionParameter("Offset", FunctionParameter.NUMBER);
fp2.setDefault(0);
var fp3 = new FunctionParameter("Lines", FunctionParameter.STRING);
fp3.addOption("On");
fp3.addOption("Off");
fp3.setDefault("On");
var fp3a = new FunctionParameter("Time", FunctionParameter.STRING);
fp3a.addOption("On");
fp3a.addOption("Off");
fp3a.setDefault("On");
var fp4 = new FunctionParameter("Cursor", FunctionParameter.STRING);
fp4.addOption("false");
fp4.addOption("true");
fp4.setDefault("true");
}
var Cntr = 0;
var x;
var y;
var z;
var w;
var pp;
function main(Interval,Offset,Lines,Time,Cursor){
setShowCursorLabel(eval(Cursor));
if(isDWM()==true){
setShowCursorLabel(false);
return;
}
if(getBarState()==BARSTATE_NEWBAR){
Cntr += 1;
}
x = (getHour()*1)+Offset;
y = getMinute()*1;
w = getSecond()*1;
if(x>=24) x = x-24;
if(x<0) x = 24+x;
if(x<5) x = "0"+x;
if(y<5) y = "0"+y;
z = x+":"+y+":"+w;
if(Lines=="On"){
if(Cntr == 1){
drawLineRelative(0,-30,0,99999,PS_SOLID, 1, Color.lightgrey,"Time"+Cntr);
pp = 1;
}
if(Cntr == (pp + 6)){
drawLineRelative(0,-30,0,99999,PS_SOLID, 1, Color.lightgrey,"Times"+Cntr);
pp = Cntr;
}
}
return z+"";
}
Comment