//+------------------------------------------------------------------+
//| super-signals.mq4 |
//| Copyright ゥ 2006, Nick Bilak, beluck[AT]gmail.com |
//|------------------------------------------------------------------|
//|Added sound,if signal direction changes SuperSignalsHotFxMOD.mq4 |
//|2012.03.20, HotFx, http://hot-fx.blogspot.com http://hotfx.0pk.ru |
//+------------------------------------------------------------------+
#property copyright "Copyright ゥ 2006, Nick Bilak"
#property link "http://www.forex-tsd.com/"
#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 Red
#property indicator_width1 2
#property indicator_color2 Blue
#property indicator_width2 2
extern int dist = 24;
extern int SignalGap = 4;
extern string SoundEntry = "news.wav";
double b1[], b2[], cur = 0;
int init()
{
SetIndexStyle(0, DRAW_ARROW, STYLE_SOLID, 1); SetIndexArrow(0, 234); SetIndexBuffer(0, b1);
SetIndexStyle(1, DRAW_ARROW, STYLE_SOLID, 1); SetIndexArrow(1, 233); SetIndexBuffer(1, b2);
}
int start()
{
int i, hhb, llb, counted_bars = IndicatorCounted();
if (counted_bars > 0) counted_bars--;
for (i = Bars - 1 - counted_bars; i >= 0; i--)
{
hhb = iHighest(NULL, 0, MODE_HIGH, dist, i - dist / 2);
llb = iLowest(NULL, 0, MODE_LOW, dist, i - dist / 2);
if (i == hhb)
{
if (SoundEntry != "" && cur != -1 && i <= dist) PlaySound(SoundEntry);
b1[i] = High[hhb] + SignalGap * Point; cur = -1;
}
if (i == llb)
{
if (SoundEntry != "" && cur != 1 && i <= dist) PlaySound(SoundEntry);
b2[i] = Low[llb] - SignalGap * Point; cur = 1;
}
}
}