I am attempting to put together an EFS that will color the chart background when a stock is within .05 (or any other # desirded) of its day high. I would also like to have a sound play say every 5 seconds as long as it is within that range of the high. I would then do the same for the low side as well.
I have the following code as a start...i'm getting an error about calling the High:
var vLastAlert = -1;
function preMain(){
setPriceStudy(true);
setStudyTitle("High");
}
function main(){
var nearhigh = callFunction("gettodayOHLC.efs","High");
if (close() <=nearhigh -0.05)
onAction1()
return null;
}
function onAction1(){
setChartBG(Color.lime);
vLastAlert = 1;
}
If anyone has any ideas on how to complete this I would greatly appreciate it. I'm still searching the msg boards for answers as well.
Thanks,
cas
I have the following code as a start...i'm getting an error about calling the High:
var vLastAlert = -1;
function preMain(){
setPriceStudy(true);
setStudyTitle("High");
}
function main(){
var nearhigh = callFunction("gettodayOHLC.efs","High");
if (close() <=nearhigh -0.05)
onAction1()
return null;
}
function onAction1(){
setChartBG(Color.lime);
vLastAlert = 1;
}
If anyone has any ideas on how to complete this I would greatly appreciate it. I'm still searching the msg boards for answers as well.
Thanks,
cas
Comment