//+------------------------------------------------------------------+
//| Veri. |
//| Copyright © 2000-2007, MetaQuotes Software Corp. |
//| _http://www.metaquotes.ru |
//+-------------------------------------------------- ----------------+
#property copyright "Copyright © 2005"
#property link "
[email protected]"
#property indicator_separate_window
#property indicator_buffers 5
#property indicator_color1 Lime
#property indicator_color2 Red
#property indicator_color3 LightGreen
#property indicator_color4 Magenta
#property indicator_color5 Yellow
#property indicator_level1 0
#property indicator_level2 0.3
#property indicator_level3 -0.3
//----
double buffer1[0];
double buffer2[0];
double buffer3[0];
double buffer4[0];
double buffer5[0];
double zerkalo=+3;
//----
extern int period=12;
extern bool Mode_Fast= True;
extern bool Signals= True;
extern int price=1;
//---- Sound ---
extern int Use_Sound = 1;
int music_buy=0;
int music_sell=0;
datetime t_buy=-1, t_sell=-1;
extern int Count_Sound=5;
extern int Time_Pause=5;
int cnt;
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
int init()
{
///*
SetIndexStyle(0,DRAW_HISTOGRAM,STYLE_SOLID,2,Lime);
SetIndexBuffer(0,buffer1);
SetIndexStyle(1,DRAW_HISTOGRAM,STYLE_SOLID,2,Red);
SetIndexBuffer(1,buffer2);
//*/
///*
SetIndexStyle(2,DRAW_HISTOGRAM,STYLE_SOLID,2,Green);
SetIndexBuffer(2,buffer3);
SetIndexStyle(3,DRAW_HISTOGRAM,STYLE_SOLID,2,Magenta);
SetIndexBuffer(3,buffer4);
SetIndexStyle(4,DRAW_HISTOGRAM,STYLE_SOLID,2,Yellow);
SetIndexBuffer(4,buffer5);
//*/
return(0);
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
int deinit()
{
int i;
double tmp;
//----
for(i=0;i<Bars;i++)
{
ObjectDelete("SELL SIGNAL: "+DoubleToStr(i,0));
ObjectDelete("BUY SIGNAL: "+DoubleToStr(i,0));
ObjectDelete("EXIT: "+DoubleToStr(i,0));
}
music_buy=0;
music_sell=0;
return(0);
}
double Fish=0,Fish1=0,Fish2=0;
//----
int buy=1,sell=1;
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
int start()
{
int i;
int barras;
int limit;
int counted_bars=IndicatorCounted();
double prev,current,old;
double Fish=0,Fish1=0,Fish2=0;
double Value; double Value1; double Value2;
double _price;
double tmp;
double MinL=0;
double MaxH=0;
double Threshold=0.000;
//----
for(i=0;i<Bars;i++)
{
ObjectDelete("SELL SIGNAL: "+DoubleToStr(i,0));
ObjectDelete("BUY SIGNAL: "+DoubleToStr(i,0));
ObjectDelete("EXIT: "+DoubleToStr(i,0));
}
if (Mode_Fast)
barras=99;
i=0;
while(i<Bars)
{
buffer1
=Open[iLowest(0,0,MODE_OPEN,period,i)];
buffer2=High[iHighest(0,0,MODE_HIGH,period,i)];
buffer3=Low[iLowest(0,0,MODE_LOW,period,i)];
buffer4=Close[iHighest(0,0,MODE_CLOSE,period,i)];
buffer5=Volume[iHighest(0,0,MODE_LOW,period,i)];
//---- MODE_HIGH+MODE_LOW
_price=(High+Low)/2;
Value=((_price-((buffer1+buffer2)-(buffer3+buffer4))/buffer5)/((buffer1+buffer2+buffer3+buffer4)-(buffer2+buffer3))-0.5);
Value=(MathMod(MathMod(Value,-0.96),0.96))/1000;
Fish=MathLog((1+Value)/(1-Value))+0.963*Fish1*Fish1;
//----
// buffer1=buffer4;
// buffer2=buffer3;
if (Fish1>=0)
{
buffer1=Fish1;
buffer3=buffer5*zerkalo;
}
else
{
buffer3=Fish2;
buffer4=buffer5*zerkalo;
}
tmp=i;
if (Fish2<-Threshold)
{
if (Signals)
{
//----
if (t_sell<0) {
t_sell=Time;
music_sell++;
}
if (Time>t_sell) {
t_sell=Time;
music_sell++;
}
//----
ObjectCreate("SELL SIGNAL: "+DoubleToStr(i,0),OBJ_TEXT,0,Time,_price);
ObjectSetText("SELL SIGNAL: "+DoubleToStr(i,0),"Veri ВНИЗ"+DoubleToStr(_price,0),7,"Arial Blaсk",Red);
}
sell=1;
}
if (Fish1>Threshold)
{
if (Signals)
{
//----
if (t_buy<0) {
t_buy=Time;
music_buy++;
}
if (Time>t_buy) {
t_buy=Time;
music_buy++;
}
//----
ObjectCreate("BUY SIGNAL: "+DoubleToStr(i,0),OBJ_TEXT,0,Time,_price);
ObjectSetText("BUY SIGNAL: "+DoubleToStr(i,0),"Veti ВВЕРХ "+DoubleToStr(_price,0),7,"Arial Blaсk",Blue);
}
buy=1;
}
// Value1=Value;
Fish2=Fish1;
Fish1=Fish;
i++;
}
//+------------------------------------------------------------------+
//| MODE Play Sound |
//+------------------------------------------------------------------+
if (Use_Sound>0) {
if (music_sell>0) {
for (cnt=0; cnt<=Count_Sound; cnt++) {
PlaySound("email.wav");
Sleep(Time_Pause*1000);
}
music_sell=0;
}
if (music_buy>0) {
for (cnt=0; cnt<=Count_Sound; cnt++) {
PlaySound("connect.wav");
Sleep(Time_Pause*1000);
}
music_buy=0;
}
}
return(0);
}
//+------------------------------------------------------------------+