I use this Efs to make the countdown of the remaining tics in tics chart, when go in "ticalert" limit setted may play a sound.
this work in TIcs frame correctly but non in vol chart, no sound on vol chart , if I change the chart in tics chart again , sound good.
anyone know where is the problem ?
thank you in advance
var nLastRawTime;
function preMain() {
setPriceStudy(true);
setStudyTitle("TICS counter");
setCursorLabelName("TICS counter");
setShowCursorLabel(true);
var fp1 = new FunctionParameter("Trigger", FunctionParameter.NUMBER);
fp1.setLowerLimit(0);
fp1.setDefault(50);
var fp2 = new FunctionParameter("Ticalert", FunctionParameter.NUMBER);
fp2.setLowerLimit(0);
fp2.setDefault(50);
}
var y = 0;
function main(Trigger,Ticalert) {
if(isRawTick()!=true||isTick()==true)
return;
var x = getInterval();
var n = parseInt(x);
if(1==1)
y += 1;
if(getBarState()==BARSTATE_NEWBAR){
y=1;
}
var z = n-y;
if(z<Trigger){
setBarFgColor(Color.red);
drawTextRelative(3,close(),z,Color.red,null,Text.B OLD|Text.VCENTER,"Arial",12,"TIB");
}else{
setBarFgColor(Color.blue);
drawTextRelative(3,close(),z,Color.white,null,Text .BOLD|Text.VCENTER,"Arial",12,"TIB");
}
if(z<Ticalert){
Alert.playSound("ticalert.wav");
return z+" ";
}
this work in TIcs frame correctly but non in vol chart, no sound on vol chart , if I change the chart in tics chart again , sound good.
anyone know where is the problem ?
thank you in advance
var nLastRawTime;
function preMain() {
setPriceStudy(true);
setStudyTitle("TICS counter");
setCursorLabelName("TICS counter");
setShowCursorLabel(true);
var fp1 = new FunctionParameter("Trigger", FunctionParameter.NUMBER);
fp1.setLowerLimit(0);
fp1.setDefault(50);
var fp2 = new FunctionParameter("Ticalert", FunctionParameter.NUMBER);
fp2.setLowerLimit(0);
fp2.setDefault(50);
}
var y = 0;
function main(Trigger,Ticalert) {
if(isRawTick()!=true||isTick()==true)
return;
var x = getInterval();
var n = parseInt(x);
if(1==1)
y += 1;
if(getBarState()==BARSTATE_NEWBAR){
y=1;
}
var z = n-y;
if(z<Trigger){
setBarFgColor(Color.red);
drawTextRelative(3,close(),z,Color.red,null,Text.B OLD|Text.VCENTER,"Arial",12,"TIB");
}else{
setBarFgColor(Color.blue);
drawTextRelative(3,close(),z,Color.white,null,Text .BOLD|Text.VCENTER,"Arial",12,"TIB");
}
if(z<Ticalert){
Alert.playSound("ticalert.wav");
return z+" ";
}
Comment