//+------------------------------------------------------------------+
// expert start function
//+------------------------------------------------------------------+
int start()
{
double MyPoint=Point;
if(Digits==3 || Digits==5) MyPoint=Point*10;
double speared =DoubleToStr(Ask-Bid,Digits);
double close = iClose(Symbol(),PERIOD_D1,1);
double low = iLow(Symbol(),PERIOD_D1,1);
double high = iHigh(Symbol(),PERIOD_D1,1);
double pivot = (close+low+high)/3;
double s1 = (pivot*2)-high;
double s2 = pivot-(high-low);
double s3 = s1-(high-low);
double r1 = (pivot*2)-low;
double r2 = pivot+(high-low);
double r3 = r1+(high-low);
ObjectDelete("lowtrend");
//ObjectCreate(0,"lowtrend",OBJ_TREND,0,Time[pivot],Low[pivot],Time[0],Low[0]);
ObjectCreate(0,"lowtrend",OBJ_HLINE,0,Time[0],pivot);
ObjectSetInteger(0,"lowtrend",OBJPROP_COLOR,Yellow);
ObjectSetInteger(0,"lowtrend",OBJPROP_STYLE,STYLE_SOLID);
ObjectSetInteger(0,"lowtrend",OBJPROP_WIDTH,1);
//r line
ObjectDelete("r1");
ObjectCreate(0,"r1",OBJ_HLINE,0,Time[0],r1);
ObjectSetInteger(0,"r1",OBJPROP_COLOR,Red);
ObjectSetInteger(0,"r1",OBJPROP_STYLE,STYLE_SOLID);
ObjectSetInteger(0,"r1",OBJPROP_WIDTH,1);
ObjectDelete("r2");
ObjectCreate(0,"r2",OBJ_HLINE,0,Time[0],r2);
ObjectSetInteger(0,"r2",OBJPROP_COLOR,White);
ObjectSetInteger(0,"r2",OBJPROP_STYLE,STYLE_SOLID);
ObjectSetInteger(0,"r2",OBJPROP_WIDTH,1);
ObjectDelete("r3");
ObjectCreate(0,"r3",OBJ_HLINE,0,Time[0],r3);
ObjectSetInteger(0,"r3",OBJPROP_COLOR,Blue);
ObjectSetInteger(0,"r3",OBJPROP_STYLE,STYLE_SOLID);
ObjectSetInteger(0,"r3",OBJPROP_WIDTH,1);
//s line
ObjectDelete("s1");
ObjectCreate(0,"s1",OBJ_HLINE,0,Time[0],s1);
ObjectSetInteger(0,"s1",OBJPROP_COLOR,Red);
ObjectSetInteger(0,"s1",OBJPROP_STYLE,STYLE_SOLID);
ObjectSetInteger(0,"s1",OBJPROP_WIDTH,1);
ObjectDelete("s2");
ObjectCreate(0,"s2",OBJ_HLINE,0,Time[0],s2);
ObjectSetInteger(0,"s2",OBJPROP_COLOR,White);
ObjectSetInteger(0,"s2",OBJPROP_STYLE,STYLE_SOLID);
ObjectSetInteger(0,"s2",OBJPROP_WIDTH,1);
ObjectDelete("s3");
ObjectCreate(0,"s3",OBJ_HLINE,0,Time[0],s3);
ObjectSetInteger(0,"s3",OBJPROP_COLOR,Blue);
ObjectSetInteger(0,"s3",OBJPROP_STYLE,STYLE_SOLID);
ObjectSetInteger(0,"s3",OBJPROP_WIDTH,1);
// open order line
ObjectDelete("buyline");
//ObjectCreate(0,"lowtrend",OBJ_TREND,0,Time[pivot],Low[pivot],Time[0],Low[0]);
ObjectCreate(0,"buyline",OBJ_VLINE,0,OrderOpenTime(),OrderOpenPrice());
ObjectSetInteger(0,"buyline",OBJPROP_COLOR,Yellow);
ObjectSetInteger(0,"buyline",OBJPROP_STYLE,STYLE_SOLID);
ObjectSetInteger(0,"buyline",OBJPROP_WIDTH,1);
Comment("Pivot ",pivot , "\n S1 ",s1, " S2 ",s2 , " S3",s3 ,"\n R1 ",r1 ," R2 ",r2," R3 ",r3);
}
No comments:
Post a Comment