How to get Point A and B

1
Dear Mladen,
What is the best way to get Point A and B to use in an EA?
I would use for timeframe M15
I would like to draw Fibo straight through the EA without using external indicator.

For H1 and H4 I use the code below
Create Fibo
HighPrice = iHigh(NULL, 0, ChartShift); // Point A
OpenTime = iTime(NULL, 0, ChartShift);
LowPrice = iLow(NULL, 0, ChartShift); // Point B
CloseTime = iTime(NULL, 0, ChartShift);

ObjectCreate("Fibo",OBJ_FIBO,0,OpenTime,HighPrice,CloseTime,LowPrice);
ObjectSet("Fibo", OBJPROP_STYLE, STYLE_DASH);
ObjectSet("Fibo", OBJPROP_COLOR, FiboColour);
ObjectSet("Fibo", OBJPROP_LEVELCOLOR, FiboColour);
ObjectSet("Fibo", OBJPROP_WIDTH, 1);
ObjectSet("Fibo", OBJPROP_FIBOLEVELS, 17);
ObjectSet("Fibo", OBJPROP_FIRSTLEVEL+0, 0);
ObjectSet("Fibo", OBJPROP_FIRSTLEVEL+1, 100);

ObjectSet("Fibo", OBJPROP_FIRSTLEVEL+0, -0.618);
ObjectSet("Fibo", OBJPROP_FIRSTLEVEL+1, -0.382);
ObjectSet("Fibo", OBJPROP_FIRSTLEVEL+2, 0);
ObjectSet("Fibo", OBJPROP_FIRSTLEVEL+3, 0.191);
ObjectSet("Fibo", OBJPROP_FIRSTLEVEL+4, 0.382);
ObjectSet("Fibo", OBJPROP_FIRSTLEVEL+5, 0.50);
ObjectSet("Fibo", OBJPROP_FIRSTLEVEL+6, 0.618);
ObjectSet("Fibo", OBJPROP_FIRSTLEVEL+7, 0.809);
Other levels etc.

Calculate level to use in EA
//Calculate the shift on the D1 if today is Monday, to leave out the Sunday candle
if (Period() == PERIOD_D1 && DayOfWeek() == 1 )
{
ChartShift = 2;
}//if (Period() == PERIOD_D1)
else ChartShift = 1;

SwingHigh = High[ChartShift];
SwingLow = Low[ChartShift];
double extent = SwingHigh - SwingLow;
Fib161_8 = NormalizeDouble(SwingLow + (extent * 161.8 / 100), Digits);

Thank you
Rogério


Who is online

Users browsing this forum: Amazon [Bot] and 16 guests