Initial Commit ...
This commit is contained in:
@@ -0,0 +1,203 @@
|
||||
# DrawFibonnaci
|
||||
|
||||
```mq4
|
||||
//
|
||||
// START Draw Fibonachi Retracement Object ...
|
||||
//
|
||||
// //
|
||||
// int fibIndex = 0;
|
||||
// int fibLevelsCount = 6;
|
||||
// int fibLevelWidths[6];
|
||||
// color fibLevelColors[6];
|
||||
// double fibLevelValues[6];
|
||||
// string fibLevelDescriptions[6];
|
||||
// ENUM_LINE_STYLE fibLevelStyles[6];
|
||||
|
||||
// //
|
||||
// // Level 1 ...
|
||||
// // 0.0
|
||||
// // clrGray ...
|
||||
// fibLevelValues[fibIndex] = 0.0;
|
||||
// fibLevelColors[fibIndex] = clrGray;
|
||||
// fibLevelStyles[fibIndex] = STYLE_DOT;
|
||||
// fibLevelWidths[fibIndex] = 1;
|
||||
// fibLevelDescriptions[fibIndex] = "0.0 @ %$";
|
||||
// fibIndex++;
|
||||
|
||||
// //
|
||||
// // Level 2 ...
|
||||
// // 0.236
|
||||
// // clrOliveDrab ...
|
||||
// fibLevelValues[fibIndex] = 0.236;
|
||||
// fibLevelColors[fibIndex] = clrOliveDrab;
|
||||
// fibLevelStyles[fibIndex] = STYLE_DOT;
|
||||
// fibLevelWidths[fibIndex] = 1;
|
||||
// fibLevelDescriptions[fibIndex] = "0.236 @ %$";
|
||||
// fibIndex++;
|
||||
|
||||
// //
|
||||
// // Level 3 ...
|
||||
// // 0.382
|
||||
// // clrYellow ...
|
||||
// fibLevelValues[fibIndex] = 0.382;
|
||||
// fibLevelColors[fibIndex] = clrYellow;
|
||||
// fibLevelStyles[fibIndex] = STYLE_DASHDOTDOT;
|
||||
// fibLevelWidths[fibIndex] = 1;
|
||||
// fibLevelDescriptions[fibIndex] = "0.382 @ %$";
|
||||
// fibIndex++;
|
||||
|
||||
// //
|
||||
// // Level 4 ...
|
||||
// // 0.5
|
||||
// // clrLime ...
|
||||
// fibLevelValues[fibIndex] = 0.5;
|
||||
// fibLevelColors[fibIndex] = clrLime;
|
||||
// fibLevelStyles[fibIndex] = STYLE_DASHDOT;
|
||||
// fibLevelWidths[fibIndex] = 1;
|
||||
// fibLevelDescriptions[fibIndex] = "0.5 @ %$";
|
||||
// fibIndex++;
|
||||
|
||||
// //
|
||||
// // Level 5 ...
|
||||
// // 0.618
|
||||
// // clrYellow ...
|
||||
// fibLevelValues[fibIndex] = 0.618;
|
||||
// fibLevelColors[fibIndex] = clrYellow;
|
||||
// fibLevelStyles[fibIndex] = STYLE_DASHDOTDOT;
|
||||
// fibLevelWidths[fibIndex] = 1;
|
||||
// fibLevelDescriptions[fibIndex] = "0.618 @ %$";
|
||||
// fibIndex++;
|
||||
|
||||
// //
|
||||
// // Level 6 ...
|
||||
// // 1
|
||||
// // clrGray ...
|
||||
// fibLevelValues[fibIndex] = 1.0;
|
||||
// fibLevelColors[fibIndex] = clrGray;
|
||||
// fibLevelStyles[fibIndex] = STYLE_DOT;
|
||||
// fibLevelWidths[fibIndex] = 1;
|
||||
// fibLevelDescriptions[fibIndex] = "1.0 @ %$";
|
||||
// fibIndex++;
|
||||
|
||||
// //
|
||||
// string fibName = StringConcatenate(
|
||||
// signalPrefix,
|
||||
// "_[", totalSignals, "]_",
|
||||
// "[Fibo]"
|
||||
// );
|
||||
|
||||
// //
|
||||
// double fibDestPrice = hasLongSignal ?
|
||||
// slInfo.longSL :
|
||||
// slInfo.shortSL;
|
||||
|
||||
// //
|
||||
// // Draw Fibonacci on Signal Propposed Area ...
|
||||
// DrawCustomFibonacci(
|
||||
// fibLevelsCount,
|
||||
// fibLevelValues,
|
||||
// fibLevelColors,
|
||||
// fibLevelStyles,
|
||||
// fibLevelWidths,
|
||||
// fibLevelDescriptions,
|
||||
// 0, // Chart ID ...
|
||||
// fibName, // Object Name ...
|
||||
// 0, // SubWindow ...
|
||||
// zigZagHighTime, // Time 1 ...
|
||||
// zigZagHigh, // Price 1 ...
|
||||
// time, // Time 2 ...
|
||||
// fibDestPrice, // Price 2 ...
|
||||
// clrCadetBlue // Fib Aroow Color ...
|
||||
// );
|
||||
|
||||
//
|
||||
// TODO: now we have to analyse Entry Point (price), using Fib ...
|
||||
// string fibLevel3Description = "";
|
||||
// fibLevel3Description = ObjectGetFiboDescription(fibName, 2);
|
||||
// string message = StringConcatenate(
|
||||
// "Fib Level 3 Desc: ",
|
||||
// fibLevel3Description
|
||||
// );
|
||||
// LogMessage(fibLevel3Description);
|
||||
|
||||
// //
|
||||
// //
|
||||
// string fibLevel5Description = "";
|
||||
|
||||
//
|
||||
double fibDestPrice = hasLongSignal ?
|
||||
slInfo.longSL :
|
||||
slInfo.shortSL;
|
||||
|
||||
//
|
||||
datetime fibTime1 = iTime(
|
||||
_Symbol,
|
||||
_Period,
|
||||
1
|
||||
);
|
||||
|
||||
//
|
||||
datetime fibTime2 = iTime(
|
||||
_Symbol,
|
||||
_Period,
|
||||
0
|
||||
);
|
||||
|
||||
//
|
||||
double minFibLevelValue = 0.382;
|
||||
double minFibLevel = GetFibonacciLevel(
|
||||
zigZagHigh, // Up ...
|
||||
fibDestPrice, // Down ...
|
||||
minFibLevelValue, // Level ...
|
||||
X_DOWN // Direction ...
|
||||
);
|
||||
string minFibLevelName = StringConcatenate(
|
||||
signalPrefix,
|
||||
"_[", totalSignals, "]_",
|
||||
"[Fibo_0.382]"
|
||||
);
|
||||
|
||||
//
|
||||
// Draw minFibLevel ...
|
||||
DrawTrendLine(
|
||||
0,
|
||||
minFibLevelName,
|
||||
0,
|
||||
fibTime1,
|
||||
minFibLevel,
|
||||
fibTime2,
|
||||
minFibLevel,
|
||||
clrYellow
|
||||
);
|
||||
|
||||
//
|
||||
double maxFibLevelValue = 0.618;
|
||||
double maxFibLevel = GetFibonacciLevel(
|
||||
zigZagHigh, // Up ...
|
||||
fibDestPrice, // Down ...
|
||||
maxFibLevelValue, // Level ...
|
||||
X_DOWN // Direction ...
|
||||
);
|
||||
string maxFibLevelName = StringConcatenate(
|
||||
signalPrefix,
|
||||
"_[", totalSignals, "]_",
|
||||
"[Fibo_0.618]"
|
||||
);
|
||||
|
||||
//
|
||||
// Draw minFibLevel ...
|
||||
DrawTrendLine(
|
||||
0,
|
||||
minFibLevelName,
|
||||
0,
|
||||
fibTime1,
|
||||
maxFibLevel,
|
||||
fibTime2,
|
||||
maxFibLevel,
|
||||
clrYellow
|
||||
);
|
||||
|
||||
//
|
||||
// END Draw Fibonachi Retracement Object ...
|
||||
//
|
||||
```
|
||||
Reference in New Issue
Block a user