I am using tick charts and need to put a Time Histogram as an indicator window at the bottom of the Chart.
Does anyone know how to do this??
Thanks...Daniel Sternthal
Does anyone know how to do this??
Thanks...Daniel Sternthal
function preMain(){
setPlotType(PLOTTYPE_HISTOGRAM);//set the plot to histogram
}
var xRawtime = null;//declare global variable
function main(){
if(xRawtime==null) xRawtime = rawtime();//initialize global variable
if(xRawtime.getValue(-1)==null) return;//null check on timestamp value of the prior bar
if(getBarState()==BARSTATE_NEWBAR)//on the first tick of each new bar
setBar(Bar.Value,-1,0,xRawtime.getValue(0)-xRawtime.getValue(-1));//calculate the difference between
//timestamp values and assign it to the previous bar
}
Comment