Please, can someone help me?
I would like to put the texts BUY and SELL, and sound alerts, when the formula make changes in colors:
/************************************************** *****************
Provided By: TS Support, LLC for eSignal. (c) Copyright 2002
************************************************** ******************/
function preMain()
{
setStudyTitle("Movtrend");
setCursorLabelName("Movtrend", 0);
setDefaultBarFgColor(Color.white, 0);
setPlotType(PLOTTYPE_INSTANTCOLORLINE);
setDefaultBarThickness(4, 0);
setPriceStudy(true);
}
var wt = null;
var wt_1 = null;
function main(n) {
if(n == null)
n = 34;
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);
setPriceBarColor(Color.navy);
}
if(wt<wt_1){
setBarFgColor(Color.purple);
setPriceBarColor(Color.red);
}
return wt;
}
I would like to put the texts BUY and SELL, and sound alerts, when the formula make changes in colors:
/************************************************** *****************
Provided By: TS Support, LLC for eSignal. (c) Copyright 2002
************************************************** ******************/
function preMain()
{
setStudyTitle("Movtrend");
setCursorLabelName("Movtrend", 0);
setDefaultBarFgColor(Color.white, 0);
setPlotType(PLOTTYPE_INSTANTCOLORLINE);
setDefaultBarThickness(4, 0);
setPriceStudy(true);
}
var wt = null;
var wt_1 = null;
function main(n) {
if(n == null)
n = 34;
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);
setPriceBarColor(Color.navy);
}
if(wt<wt_1){
setBarFgColor(Color.purple);
setPriceBarColor(Color.red);
}
return wt;
}
Comment