I have the same indicator on 3 different time frames, the indicator turns red or green, I would like to create a EFS, to be installed in the main time frame, which also shows me what color are the indicator in the other 2 time frame.
I don't know, like a "traffic light" with 2 circles that are green or red on top of the chart you can have different indications of different time frames?
Thank in advance.
the EFs is this, :
function preMain()
{
setStudyTitle("TH");
setCursorLabelName("TH", 0);
setDefaultBarFgColor(Color.white, 0);
setPlotType(PLOTTYPE_INSTANTCOLORLINE);
setDefaultBarThickness(3, 0);
setPriceStudy(true);
}
var wt = null;
var wt_1 = null;
function main(n) {
if(n == null)
n = 18;
var sum = 0;
var i = 0;
if(getBarState()==BARSTATE_NEWBAR){
wt_1 = wt;
}
for(i = n; i > 0; i--)
sum += (i - (n + 1) / 3) * close(i - n);
wt = 6 / (n * (n + 1)) * sum;
if(wt>wt_1)
setBarFgColor(Color.lime);
else if(wt<wt_1)
setBarFgColor(Color.red);
return wt;
}
I don't know, like a "traffic light" with 2 circles that are green or red on top of the chart you can have different indications of different time frames?
Thank in advance.
the EFs is this, :
function preMain()
{
setStudyTitle("TH");
setCursorLabelName("TH", 0);
setDefaultBarFgColor(Color.white, 0);
setPlotType(PLOTTYPE_INSTANTCOLORLINE);
setDefaultBarThickness(3, 0);
setPriceStudy(true);
}
var wt = null;
var wt_1 = null;
function main(n) {
if(n == null)
n = 18;
var sum = 0;
var i = 0;
if(getBarState()==BARSTATE_NEWBAR){
wt_1 = wt;
}
for(i = n; i > 0; i--)
sum += (i - (n + 1) / 3) * close(i - n);
wt = 6 / (n * (n + 1)) * sum;
if(wt>wt_1)
setBarFgColor(Color.lime);
else if(wt<wt_1)
setBarFgColor(Color.red);
return wt;
}