Inserted Code
double bars = 0; extern double value = 0.0000; int start() { if (Bars>bars) { bars=Bars; if (Open[1]>value&&Close[1]<value||Open[1]<value&&Close[1]>value) { Alert("Trend Change at Symbol()"); } } return(0); }
This simple EA is supposed to alert me if, previous bar price crosses a preset level in either direction. Say preset level is 5 and in the Previous bar the open was 2 and the close was 9. It crossed 5. The previous bar's open and close was on either side of the preset value of 5. Its should alert me (crosses in either direction).
It doesn't seem to work. I tried like 8-9 times. Someone please help ?