Price alert on line cross New comment kovas6 2010.03.19 21:47 Hi, I am writing EA to trigger alert on price crossing the line, but it is not working, could you help ? extern string MLine_Name = "MLine"; extern color MLine_Color = Goldenrod; extern int MLine_Style = 1; extern int MLine_Width = 2; extern int AlertPipRange = 3; extern bool Line_Alert = false; string AlertWav = "alert.wav"; int init() {} int start() { int counted_bars=IndicatorCounted(); ObjectCreate(MLine_Name, OBJ_HLINE, 0,Bid,Ask); ObjectSet(MLine_Name,OBJPROP_COLOR,MLine_Color); ObjectSet(MLine_Name,OBJPROP_STYLE,MLine_Style); ObjectSet(MLine_Name,OBJPROP_WIDTH,MLine_Width); double val=ObjectGetValueByShift(MLine_Name, 0); if (Bid-AlertPipRange<= val && Bid+AlertPipRange>= val) if (Line_Alert==true) { PlaySound("alert.wav"); } } int deinit() { } thanks kovas linear regression channel missing code price alart in fast moves Email me only 1 time on Trendline Touch - How to do it? Alexander 2010.03.19 22:32 #1 ObjectCreate(MLine_Name, OBJ_HLINE, 0,Bid,Ask); - wrong! kovas6 2010.03.20 11:23 #2 Roger wrote >> ObjectCreate(MLine_Name, OBJ_HLINE, 0,Bid,Ask); - wrong! hi Roger, what is wrong in thi part? thanks aurimas Alexander 2010.03.20 19:40 #3 You have to use time and price as coordinates, not price and price. kovas6 2010.03.20 20:22 #4 Roger wrote >> You have to use time and price as coordinates, not price and price. thank you very much, it is weekend now and i cant test it, i hope no more mistakes i made... kovas6 2010.03.22 15:03 #5 still not working :( [Deleted] 2010.03.22 21:55 #6 kovas6 wrote >> still not working :( Hi if you want EA that sends you email or sms when price touches any kind of line you define it on chart. let me know if that what you want. Anthony kovas6 2010.03.23 10:08 #7 Anthony, yes [Deleted] 2010.03.23 11:47 #8 kovas6 wrote >> Anthony, yes write your email kovas6 2010.03.23 18:03 #9 i wrote in a PM [Deleted] 2010.03.23 18:37 #10 kovas6 wrote >> i wrote in a PM sent you email New comment
Hi,
I am writing EA to trigger alert on price crossing the line, but it is not working, could you help ?
extern string MLine_Name = "MLine";
extern color MLine_Color = Goldenrod;
extern int MLine_Style = 1;
extern int MLine_Width = 2;
extern int AlertPipRange = 3;
extern bool Line_Alert = false;
string AlertWav = "alert.wav";
int init() {}
int start()
{
int counted_bars=IndicatorCounted();
ObjectCreate(MLine_Name, OBJ_HLINE, 0,Bid,Ask);
ObjectSet(MLine_Name,OBJPROP_COLOR,MLine_Color);
ObjectSet(MLine_Name,OBJPROP_STYLE,MLine_Style);
ObjectSet(MLine_Name,OBJPROP_WIDTH,MLine_Width);
double val=ObjectGetValueByShift(MLine_Name, 0);
if (Bid-AlertPipRange<= val && Bid+AlertPipRange>= val)
if (Line_Alert==true)
{
PlaySound("alert.wav");
}
}
int deinit() { }
thanks
kovas