static datetime previousBar;
if(previousBar!=Time[0])
{
previousBar=Time[0];
ChartRedraw();
}
else
{
return;
}
if(iVolume(Symbol(),PERIOD_H4,0)>iVolume(Symbol(),PERIOD_H4,1))
return;
//**********************************
if(!BytesToRead>0)
return;
int pos = -1 ;
for(int i = 0 ; i < BytesToRead - 1 ; i++)
{
if(!(data[i][0]<Time[0]))
break;
pos = i + 1;
}
//********************************
HideTestIndicators(true);
double wpr= iWPR(Symbol(),0,4,0);
double ao = iAO(Symbol(),0,0);
HideTestIndicators(false);
double level=NormalizeDouble(data[pos][1],Digits);
ObjectDelete("level");
MakeLine(level);
if(data[pos][1]>Open[0])
Comment("BUY - ", data[pos][1]);
if(data[pos][1]<Open[0])
Comment("SELL - ", data[pos][1]);
//+------------------------------------------------------------------+
/*string CandleStick_Analyzer()
{
RefreshRates();
string CandleStick, Comment="";
if(SpinningTopExists())
Comment =" Spinning Top ";
CandleStick =Comment;
return (CandleStick);
}
bool SpinningTopExists()
{
HideTestIndicators(true);
if(High[1] - Low[1] > 1.5*iATR(NULL, 0, 14, 1))
Print("ST Condition 1 Met");
if(MathAbs(Open[1] - Close[1])*5 < High[1] - Low[1])
Print("ST Condition 2 Met");
if(High[1] - Low[1] > 1.5*iATR(NULL, 0, 14, 1) && (High[1] - Low[1] > 30*Point) && MathAbs(Open[1] - Close[1])*5 < High[1]- Low[1])
return (true);
HideTestIndicators(false);
return (false);
}*/
//+------------------------------------------------------------------+
void MakeLine(double price)
{
string name="level";
if(price>iOpen(Symbol(),PERIOD_M5,0))
Comment("BUY = "+DoubleToStr(price,Digits));
if(price<iOpen(Symbol(),PERIOD_M5,0))
Comment("SELL= "+DoubleToStr(price,Digits));
if(ObjectFind(name)!=-1)
{
ObjectMove(name,0,iTime(Symbol(),PERIOD_M1,0),price);
return;
}
ObjectCreate(name,OBJ_HLINE,0,0,price);
ObjectSet(name,OBJPROP_COLOR,clrAqua);
ObjectSet(name,OBJPROP_STYLE,STYLE_SOLID);
ObjectSet(name,OBJPROP_WIDTH,2);
ObjectSet(name,OBJPROP_BACK,TRUE);
}
}