Hi all
I'm trying to code an early break-out style alert system. This is the code that I have
The top coding has been taken and adjusted from terms.efs which I've downloaded from here. The alerts side has been copied from the formula wizard, so its a bit of a jigsaw puzzle. My questions are:
Why can't I get an audio alert up?
As I have the alert.addtolist, where would the alert show?
Is it possible to have the setDefaultBarFgColor completely invisible. At the moment it's blocking out some of the numbers
Is it possible to test it out after hours. I tried testing it on the tick replay, but all that happened was it said Crystal ball ....loading data.
If you could answer these questions it would be much appricated
Mark
PS: Just in case you couldn't tell this is my first EFS project
I'm trying to code an early break-out style alert system. This is the code that I have
Code:
var vDonchian = new DonchianStudy(7, 0); //change the 13 to the number of bars before 1030 // this is done by taking the interval in minutes divided into 60, so for a 5 min chart, 60/5 is 13 function preMain(){ setPriceStudy(true); setStudyTitle("Crystal Ball"); setCursorLabelName("a", 0); setCursorLabelName("b", 1); setDefaultBarStyle(PS_SOLID, 0); setDefaultBarStyle(PS_SOLID, 1); setDefaultBarFgColor(Color.white, 0); setDefaultBarFgColor(Color.white, 1); setDefaultBarThickness(1, 0); setDefaultBarThickness(1, 1); setPlotType(PLOTTYPE_LINE, 0); setPlotType(PLOTTYPE_LINE, 1); } function main(){ BarHr = getHour(); BarMin = getMinute(); cBarTimeInt =BarHr*100+BarMin*1; if(cBarTimeInt<1455){ hrOne=0; return null; } if(cBarTimeInt>=1455 && hrOne==0){ hrOne=1; hrOneHi=vDonchian.getValue(DonchianStudy.UPPER); hrOneLo=vDonchian.getValue(DonchianStudy.LOWER); return new Array(high(), low()); } if(hrOne==1){ return new Array(hrOneHi, hrOneLo); } return null; /** * The main() function is called once per bar on all previous bars, once per * each incoming completed bar, and if you don't have 'setComputeOnClose(true)' * in your preMain(), it is also called on every tick. */ //{{EFSWizard_Expressions //{{EFSWizard_Expression_1 if ( ((close() - hrOneLo) / (hrOneHi - hrOneLo)) > 0.95 ((close() - hrOneLo) / (hrOneHi - hrOneLo)) < 1 ) onAction1() //}}EFSWizard_Expression_1 5117 //{{EFSWizard_Expression_2 else if ( ((close() - hrOneLo) / (hrOneHi - hrOneLo)) < 0.05 ((close() - hrOneLo) / (hrOneHi - hrOneLo)) > 0 ) onAction2(); //}}EFSWizard_Expression_2 7666 //}}EFSWizard_Expressions 33535 //{{EFSWizard_Return return null; //}}EFSWizard_Return 2256 } function postMain() { /** * The postMain() function is called only once, when the EFS is no longer used for * the current symbol (ie, symbol change, chart closing, or application shutdown). */ } //{{EFSWizard_Actions //{{EFSWizard_Action_1 function onAction1() { Alert.addToList(getSymbol(), "", Color.RGB(0,0,0), Color.RGB(195,0,0)); Alert.playSound("C:\\Program Files\\eSignal\\Sounds\\New.wav"); vLastAlert = 1; } //}}EFSWizard_Action_1 23124 //{{EFSWizard_Action_2 function onAction2() { Alert.addToList(getSymbol(), "", Color.RGB(0,0,0), Color.RGB(195,0,0)); Alert.playSound("C:\\Program Files\\eSignal\\Sounds\\New.wav"); vLastAlert = 2; } //}}EFSWizard_Action_2 24494 //}}EFSWizard_Actions 69550
Why can't I get an audio alert up?
As I have the alert.addtolist, where would the alert show?
Is it possible to have the setDefaultBarFgColor completely invisible. At the moment it's blocking out some of the numbers
Is it possible to test it out after hours. I tried testing it on the tick replay, but all that happened was it said Crystal ball ....loading data.
If you could answer these questions it would be much appricated
Mark
PS: Just in case you couldn't tell this is my first EFS project
Comment