Woodies Pivot Points (Intraday/Daily) free

by moza11 in category Other at 10/08/2012
Description

Similar to regular Pivot Points but Pivot Line is calculated with more weight to the closing price. Pivot Points is a method for calculating support and resistance levels. Resistance and support levels indicate where a major price movement is expected. As a trend indicator, it indicates an upward movement, for instance, if the pivot point price is broken in, then the market is bullish, and vice versa. Pivot points are short-term trend indicators, however and therefore useful for only one day. The second method is to use pivot point price levels to enter and exit the markets.

Woodie Pivot Points chartshot

Notification Publishing copyrighted material is strictly prohibited. If you believe there is copyrighted material in this section you may use the Copyright Infringement Notification form to submit a claim.
Formula / Source Code
Language: C#
Trading Platform: cAlgocTrader
using System;
using cAlgo.API;

namespace cAlgo.Indicators
{
    [Indicator(IsOverlay = true, AccessRights = AccessRights.None)]
    public class WoodiePivotPoints : Indicator
    {
        private double _close;
        private double _higher;
        private double _lower;

        #region Output
        
        [Output("Pivot", LineStyle = LineStyle.Lines)]
        public IndicatorDataSeries Pivot { get; set; }

        [Output("R1", LineStyle = LineStyle.Lines, Color = Colors.Blue)]
        public IndicatorDataSeries R1 { get; set; }

        [Output("R2", LineStyle = LineStyle.Lines, Color = Colors.Blue)]
        public IndicatorDataSeries R2 { get; set; }

        [Output("R3", LineStyle = LineStyle.Lines, Color = Colors.Blue)]
        public IndicatorDataSeries R3 { get; set; }

        [Output("S1", LineStyle = LineStyle.Lines, Color = Colors.Red)]
        public IndicatorDataSeries S1 { get; set; }

        [Output("S2", LineStyle = LineStyle.Lines, Color = Colors.Red)]
        public IndicatorDataSeries S2 { get; set; }

        [Output("S3", LineStyle = LineStyle.Lines, Color = Colors.Red)]
        public IndicatorDataSeries S3 { get; set; }

        #endregion

        #region Input Parameters

        [Parameter("DrawingWidth", DefaultValue = 50, MaxValue = 100)]
        public int DrawingWidth { get; set; }

        [Parameter("Number of Pivots", DefaultValue = 3, MinValue = 1, MaxValue = 3)]
        public int NoPiv { get; set; }

        #endregion

        public override void Calculate(int index)
        {
            DateTime currentOpenTime = MarketSeries.OpenTime[index];
            DateTime previousOpenTime = MarketSeries.OpenTime[index - 1];
            DateTime today = DateTime.Now;
            DateTime yesterday = DateTime.Now.AddDays(-1);

            // Initialize High & Low
            if (currentOpenTime.Day == yesterday.Day && previousOpenTime.Day != yesterday.Day)
            {
                _higher = MarketSeries.High[index];
                _lower = MarketSeries.Low[index];
            }

            // Calculate High & Low of previous day
            if ((currentOpenTime.Day == yesterday.Day && today.DayOfWeek != DayOfWeek.Monday) ||
            (today.DayOfWeek == DayOfWeek.Monday && currentOpenTime.DayOfYear == today.AddDays(-3).Day))
            {
                if (MarketSeries.High[index] > _higher)
                {
                    _higher = MarketSeries.High[index];
                }
                if (MarketSeries.Low[index] < _lower)
                {
                    _lower = MarketSeries.Low[index];
                }
            }

            // Set Close of previous day - Close of Last Bar of prevous Day
            if (previousOpenTime.Day == yesterday.Day && currentOpenTime.Day == today.Day)
            {
                _close = MarketSeries.Close[index - 1];
            }
            
            // Only show output in todays timeframe
            if (currentOpenTime.Date != today.Date) return;
            
            // Calculate output
            Pivot[index] = (_higher + _lower + 2 * _close)/4;
            
            R1[index] = 2*Pivot[index] - _lower;
            S1[index] = 2*Pivot[index] - _higher;
            // Display additional pivots according to input
            if (NoPiv >= 2)
            {
                R2[index] = Pivot[index] + (_higher - _lower);
                S2[index] = Pivot[index] - (_higher - _lower);
            }
            if (NoPiv < 3) return;

            R3[index] = _higher + 2*(Pivot[index] - _lower);
            S3[index] = _lower - 2*(_higher - Pivot[index]);

        }
    }
}
Comments

sobab39491 - October 03, 2022 @ 14:26

Great post it is very helpful and informative content thanks to posting it Cyberpunk 2077 Edgerunners Jacket

doyleleyla - January 06, 2023 @ 07:23

wow! your content is very helpful for us such a nicer article provide I really impressed this stuff black pelle pelle leather jacket

5