Skip to content

Commit

Permalink
Improves Fibonacci calculation for Pivot
Browse files Browse the repository at this point in the history
  • Loading branch information
kenorb committed Sep 10, 2023
1 parent a593ae8 commit 7b292b7
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions Bar.struct.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,16 @@ struct BarOHLC
break;
case PP_FIBONACCI:
_pp = GetPivot();
_r1 = (double)(_pp + 0.382 * _range);
_r2 = (double)(_pp + 0.618 * _range);
_r3 = _pp + _range;
_r4 = _r1 + _range; // ?
_s1 = (double)(_pp - 0.382 * _range);
_s2 = (double)(_pp - 0.618 * _range);
_s3 = _pp - _range;
_s4 = _s1 - _range; // ?
_r1 = (double)(_pp + 0.236 * _range);
_r2 = (double)(_pp + 0.382 * _range);
_r3 = (double)(_pp + 0.500 * _range);
_r4 = (double)(_pp + 0.618 * _range);
// _r5 = (double)(_pp + 0.786 * _range);
_s1 = (double)(_pp - 0.236 * _range);
_s2 = (double)(_pp - 0.382 * _range);
_s3 = (double)(_pp - 0.500 * _range);
_s4 = (double)(_pp - 0.618 * _range);
// _s5 = (double)(_pp - 0.786 * _range);
break;
case PP_FLOOR:
// Most basic and popular type of pivots used in Forex trading technical analysis.
Expand Down

0 comments on commit 7b292b7

Please sign in to comment.