Category Other  Published on 26/01/2023

Pitchfork Drawing

Description

 The Pitchfork Drawing indicator allows you to draw all of the most popular Pitchfork technical analysis tools on your cTrader chart, this indicator uses Automate API chart controls and object.

It works like a built-in tool of cTrader platform and doesn't get too much space on your charts, you can expand it when you want to use it and then collapse it.

Features

  • You can draw Pitchfork original, Schiff, modified Schiff, and Pitchfan
  • Expand/collapse the buttons
  • Save/load the drawings on/from file
  • Show/Hide drawings
  • Timeframe filter
  • Remove all drawings with one click

This indicator is open source, if you are interested you can contribute on Github:

 

 

Changelog

Version 1.2.0.0

Release Date: January 26, 2023

Changed: String color parameters to new Color type parameter

Note: This version only works on cTrader 4.6 or above.

Version 1.1.0.0

Release Date: December 20, 2022

Fixed: Issues with new versions of cTrader

Changed: Target framework from .NET 4 to 6


using cAlgo.API;
using cAlgo.Controls;
using cAlgo.Helpers;
using cAlgo.Patterns;
using System.Collections.Generic;
using System.Linq;

namespace cAlgo
{
    [Indicator(IsOverlay = true, TimeZone = TimeZones.UTC, AccessRights = AccessRights.FullAccess)]
    public class PitchforkDrawing : Indicator
    {
        private StackPanel _mainButtonsPanel;

        private StackPanel _groupButtonsPanel;

        private StackPanel _mainPanel;

        private Style _buttonsStyle;

        private readonly List<Button> _buttons = new();

        private Button _expandButton;

        #region Patterns color parameters

        [Parameter("Color", DefaultValue = "70FFC000", Group = "Patterns Color")]
        public Color PatternsColor { get; set; }
        
        #endregion Patterns color parameters

        #region Patterns Label parameters

        [Parameter("Show", DefaultValue = true, Group = "Patterns Label")]
        public bool PatternsLabelShow { get; set; }

        [Parameter("Color", DefaultValue = "Yellow", Group = "Patterns Label")]
        public Color PatternsLabelColor { get; set; }

        [Parameter("Locked", DefaultValue = true, Group = "Patterns Label")]
        public bool PatternsLabelLocked { get; set; }

        [Parameter("Link Style", DefaultValue = true, Group = "Patterns Label")]
        public bool PatternsLabelLinkStyle { get; set; }

        #endregion Patterns Label parameters

        #region Container Panel parameters

        [Parameter("Orientation", DefaultValue = Orientation.Vertical, Group = "Container Panel")]
        public Orientation PanelOrientation { get; set; }

        [Parameter("Horizontal Alignment", DefaultValue = HorizontalAlignment.Left, Group = "Container Panel")]
        public HorizontalAlignment PanelHorizontalAlignment { get; set; }

        [Parameter("Vertical Alignment", DefaultValue = VerticalAlignment.Top, Group = "Container Panel")]
        public VerticalAlignment PanelVerticalAlignment { get; set; }

        [Parameter("Margin", DefaultValue = 3, Group = "Container Panel")]
        public double PanelMargin { get; set; }

        #endregion Container Panel parameters

        #region Buttons parameters

        [Parameter("Disable Color", DefaultValue = "#FFCCCCCC", Group = "Buttons")]
        public Color ButtonsBackgroundDisableColor { get; set; }

        [Parameter("Enable Color", DefaultValue = "Red", Group = "Buttons")]
        public Color ButtonsBackgroundEnableColor { get; set; }

        [Parameter("Text Color", DefaultValue = "Blue", Group = "Buttons")]
        public Color ButtonsForegroundColor { get; set; }

        [Parameter("Margin", DefaultValue = 1, Group = "Buttons")]
        public double ButtonsMargin { get; set; }

        [Parameter("Transparency", DefaultValue = 0.5, MinValue = 0, MaxValue = 1, Group = "Buttons")]
        public double ButtonsTransparency { get; set; }

        #endregion Buttons parameters

        #region TimeFrame Visibility parameters

        [Parameter("Enable", DefaultValue = false, Group = "TimeFrame Visibility")]
        public bool IsTimeFrameVisibilityEnabled { get; set; }

        [Parameter("TimeFrame", Group = "TimeFrame Visibility")]
        public TimeFrame VisibilityTimeFrame { get; set; }

        [Parameter("Only Buttons", Group = "TimeFrame Visibility")]
        public bool VisibilityOnlyButtons { get; set; }

        #endregion TimeFrame Visibility parameters

        #region Original Pitchfork parameters

        [Parameter("Median Thickness", DefaultValue = 1, MinValue = 1, Group = "Original Pitchfork")]
        public int OriginalPitchforkMedianThickness { get; set; }

        [Parameter("Median Style", DefaultValue = LineStyle.Solid, Group = "Original Pitchfork")]
        public LineStyle OriginalPitchforkMedianStyle { get; set; }

        [Parameter("Median Color", DefaultValue = "Blue", Group = "Original Pitchfork")]
        public string OriginalPitchforkMedianColor { get; set; }

        [Parameter("Show 1st Level", DefaultValue = true, Group = "Original Pitchfork")]
        public bool ShowFirstOriginalPitchfork { get; set; }

        [Parameter("1st Level Percent", DefaultValue = 0.25, Group = "Original Pitchfork")]
        public double FirstOriginalPitchforkPercent { get; set; }

        [Parameter("1st Level Color", DefaultValue = "Gray", Group = "Original Pitchfork")]
        public Color FirstOriginalPitchforkColor { get; set; }
        
        [Parameter("1st Level Thickness", DefaultValue = 1, MinValue = 0, Group = "Original Pitchfork")]
        public int FirstOriginalPitchforkThickness { get; set; }

        [Parameter("1st Level Style", DefaultValue = LineStyle.Solid, Group = "Original Pitchfork")]
        public LineStyle FirstOriginalPitchforkStyle { get; set; }

        [Parameter("Show 2nd Level", DefaultValue = true, Group = "Original Pitchfork")]
        public bool ShowSecondOriginalPitchfork { get; set; }

        [Parameter("2nd Level Percent", DefaultValue = 0.382, Group = "Original Pitchfork")]
        public double SecondOriginalPitchforkPercent { get; set; }

        [Parameter("2nd Level Color", DefaultValue = "Red", Group = "Original Pitchfork")]
        public Color SecondOriginalPitchforkColor { get; set; }

        [Parameter("2nd Level Thickness", DefaultValue = 1, MinValue = 0, Group = "Original Pitchfork")]
        public int SecondOriginalPitchforkThickness { get; set; }

        [Parameter("2nd Level Style", DefaultValue = LineStyle.Solid, Group = "Original Pitchfork")]
        public LineStyle SecondOriginalPitchforkStyle { get; set; }

        [Parameter("Show 3rd Level", DefaultValue = true, Group = "Original Pitchfork")]
        public bool ShowThirdOriginalPitchfork { get; set; }

        [Parameter("3rd Level Percent", DefaultValue = 0.5, Group = "Original Pitchfork")]
        public double ThirdOriginalPitchforkPercent { get; set; }

        [Parameter("3rd Level Color", DefaultValue = "GreenYellow", Group = "Original Pitchfork")]
        public Color ThirdOriginalPitchforkColor { get; set; }

        [Parameter("3rd Level Thickness", DefaultValue = 1, MinValue = 0, Group = "Original Pitchfork")]
        public int ThirdOriginalPitchforkThickness { get; set; }

        [Parameter("3rd Level Style", DefaultValue = LineStyle.Solid, Group = "Original Pitchfork")]
        public LineStyle ThirdOriginalPitchforkStyle { get; set; }

        [Parameter("Show 4th Level", DefaultValue = true, Group = "Original Pitchfork")]
        public bool ShowFourthOriginalPitchfork { get; set; }

        [Parameter("4th Level Percent", DefaultValue = 0.618, Group = "Original Pitchfork")]
        public double FourthOriginalPitchforkPercent { get; set; }

        [Parameter("4th Level Color", DefaultValue = "DarkGreen", Group = "Original Pitchfork")]
        public Color FourthOriginalPitchforkColor { get; set; }

        [Parameter("4th Level Thickness", DefaultValue = 1, MinValue = 0, Group = "Original Pitchfork")]
        public int FourthOriginalPitchforkThickness { get; set; }

        [Parameter("4th Level Style", DefaultValue = LineStyle.Solid, Group = "Original Pitchfork")]
        public LineStyle FourthOriginalPitchforkStyle { get; set; }

        [Parameter("Show 5th Level", DefaultValue = true, Group = "Original Pitchfork")]
        public bool ShowFifthOriginalPitchfork { get; set; }

        [Parameter("5th Level Percent", DefaultValue = 0.75, Group = "Original Pitchfork")]
        public double FifthOriginalPitchforkPercent { get; set; }

        [Parameter("5th Level Color", DefaultValue = "BlueViolet", Group = "Original Pitchfork")]
        public Color FifthOriginalPitchforkColor { get; set; }

        [Parameter("5th Level Thickness", DefaultValue = 1, MinValue = 0, Group = "Original Pitchfork")]
        public int FifthOriginalPitchforkThickness { get; set; }

        [Parameter("5th Level Style", DefaultValue = LineStyle.Solid, Group = "Original Pitchfork")]
        public LineStyle FifthOriginalPitchforkStyle { get; set; }

        [Parameter("Show 6th Level", DefaultValue = true, Group = "Original Pitchfork")]
        public bool ShowSixthOriginalPitchfork { get; set; }

        [Parameter("6th Level Percent", DefaultValue = 1, Group = "Original Pitchfork")]
        public double SixthOriginalPitchforkPercent { get; set; }

        [Parameter("6th Level Color", DefaultValue = "AliceBlue", Group = "Original Pitchfork")]
        public Color SixthOriginalPitchforkColor { get; set; }

        [Parameter("6th Level Thickness", DefaultValue = 1, MinValue = 0, Group = "Original Pitchfork")]
        public int SixthOriginalPitchforkThickness { get; set; }

        [Parameter("6th Level Style", DefaultValue = LineStyle.Solid, Group = "Original Pitchfork")]
        public LineStyle SixthOriginalPitchforkStyle { get; set; }

        [Parameter("Show 7th Level", DefaultValue = true, Group = "Original Pitchfork")]
        public bool ShowSeventhOriginalPitchfork { get; set; }

        [Parameter("7th Level Percent", DefaultValue = 1.5, Group = "Original Pitchfork")]
        public double SeventhOriginalPitchforkPercent { get; set; }

        [Parameter("7th Level Color", DefaultValue = "Bisque", Group = "Original Pitchfork")]
        public Color SeventhOriginalPitchforkColor { get; set; }

        [Parameter("7th Level Thickness", DefaultValue = 1, MinValue = 0, Group = "Original Pitchfork")]
        public int SeventhOriginalPitchforkThickness { get; set; }

        [Parameter("7th Level Style", DefaultValue = LineStyle.Solid, Group = "Original Pitchfork")]
        public LineStyle SeventhOriginalPitchforkStyle { get; set; }

        [Parameter("Show 8th Level", DefaultValue = true, Group = "Original Pitchfork")]
        public bool ShowEighthOriginalPitchfork { get; set; }

        [Parameter("8th Level Percent", DefaultValue = 1.75, Group = "Original Pitchfork")]
        public double EighthOriginalPitchforkPercent { get; set; }

        [Parameter("8th Level Color", DefaultValue = "Azure", Group = "Original Pitchfork")]
        public Color EighthOriginalPitchforkColor { get; set; }

        [Parameter("8th Level Thickness", DefaultValue = 1, MinValue = 0, Group = "Original Pitchfork")]
        public int EighthOriginalPitchforkThickness { get; set; }

        [Parameter("8th Level Style", DefaultValue = LineStyle.Solid, Group = "Original Pitchfork")]
        public LineStyle EighthOriginalPitchforkStyle { get; set; }

        [Parameter("Show 9th Level", DefaultValue = true, Group = "Original Pitchfork")]
        public bool ShowNinthOriginalPitchfork { get; set; }

        [Parameter("9th Level Percent", DefaultValue = 2, Group = "Original Pitchfork")]
        public double NinthOriginalPitchforkPercent { get; set; }

        [Parameter("9th Level Color", DefaultValue = "Aqua", Group = "Original Pitchfork")]
        public Color NinthOriginalPitchforkColor { get; set; }

        [Parameter("9th Level Thickness", DefaultValue = 1, MinValue = 0, Group = "Original Pitchfork")]
        public int NinthOriginalPitchforkThickness { get; set; }

        [Parameter("9th Level Style", DefaultValue = LineStyle.Solid, Group = "Original Pitchfork")]
        public LineStyle NinthOriginalPitchforkStyle { get; set; }

        #endregion Original Pitchfork parameters

        #region Schiff Pitchfork parameters

        [Parameter("Median Thickness", DefaultValue = 1, MinValue = 1, Group = "Schiff Pitchfork")]
        public int SchiffPitchforkMedianThickness { get; set; }

        [Parameter("Median Style", DefaultValue = LineStyle.Solid, Group = "Schiff Pitchfork")]
        public LineStyle SchiffPitchforkMedianStyle { get; set; }

        [Parameter("Median Color", DefaultValue = "Blue", Group = "Schiff Pitchfork")]
        public Color SchiffPitchforkMedianColor { get; set; }

        [Parameter("Show 1st Level", DefaultValue = true, Group = "Schiff Pitchfork")]
        public bool ShowFirstSchiffPitchfork { get; set; }

        [Parameter("1st Level Percent", DefaultValue = 0.25, Group = "Schiff Pitchfork")]
        public double FirstSchiffPitchforkPercent { get; set; }

        [Parameter("1st Level Color", DefaultValue = "Gray", Group = "Schiff Pitchfork")]
        public Color FirstSchiffPitchforkColor { get; set; }

        [Parameter("1st Level Thickness", DefaultValue = 1, MinValue = 0, Group = "Schiff Pitchfork")]
        public int FirstSchiffPitchforkThickness { get; set; }

        [Parameter("1st Level Style", DefaultValue = LineStyle.Solid, Group = "Schiff Pitchfork")]
        public LineStyle FirstSchiffPitchforkStyle { get; set; }

        [Parameter("Show 2nd Level", DefaultValue = true, Group = "Schiff Pitchfork")]
        public bool ShowSecondSchiffPitchfork { get; set; }

        [Parameter("2nd Level Percent", DefaultValue = 0.382, Group = "Schiff Pitchfork")]
        public double SecondSchiffPitchforkPercent { get; set; }

        [Parameter("2nd Level Color", DefaultValue = "Red", Group = "Schiff Pitchfork")]
        public Color SecondSchiffPitchforkColor { get; set; }

        [Parameter("2nd Level Thickness", DefaultValue = 1, MinValue = 0, Group = "Schiff Pitchfork")]
        public int SecondSchiffPitchforkThickness { get; set; }

        [Parameter("2nd Level Style", DefaultValue = LineStyle.Solid, Group = "Schiff Pitchfork")]
        public LineStyle SecondSchiffPitchforkStyle { get; set; }

        [Parameter("Show 3rd Level", DefaultValue = true, Group = "Schiff Pitchfork")]
        public bool ShowThirdSchiffPitchfork { get; set; }

        [Parameter("3rd Level Percent", DefaultValue = 0.5, Group = "Schiff Pitchfork")]
        public double ThirdSchiffPitchforkPercent { get; set; }

        [Parameter("3rd Level Color", DefaultValue = "GreenYellow", Group = "Schiff Pitchfork")]
        public Color ThirdSchiffPitchforkColor { get; set; }

        [Parameter("3rd Level Thickness", DefaultValue = 1, MinValue = 0, Group = "Schiff Pitchfork")]
        public int ThirdSchiffPitchforkThickness { get; set; }

        [Parameter("3rd Level Style", DefaultValue = LineStyle.Solid, Group = "Schiff Pitchfork")]
        public LineStyle ThirdSchiffPitchforkStyle { get; set; }

        [Parameter("Show 4th Level", DefaultValue = true, Group = "Schiff Pitchfork")]
        public bool ShowFourthSchiffPitchfork { get; set; }

        [Parameter("4th Level Percent", DefaultValue = 0.618, Group = "Schiff Pitchfork")]
        public double FourthSchiffPitchforkPercent { get; set; }

        [Parameter("4th Level Color", DefaultValue = "DarkGreen", Group = "Schiff Pitchfork")]
        public Color FourthSchiffPitchforkColor { get; set; }

        [Parameter("4th Level Thickness", DefaultValue = 1, MinValue = 0, Group = "Schiff Pitchfork")]
        public int FourthSchiffPitchforkThickness { get; set; }

        [Parameter("4th Level Style", DefaultValue = LineStyle.Solid, Group = "Schiff Pitchfork")]
        public LineStyle FourthSchiffPitchforkStyle { get; set; }

        [Parameter("Show 5th Level", DefaultValue = true, Group = "Schiff Pitchfork")]
        public bool ShowFifthSchiffPitchfork { get; set; }

        [Parameter("5th Level Percent", DefaultValue = 0.75, Group = "Schiff Pitchfork")]
        public double FifthSchiffPitchforkPercent { get; set; }

        [Parameter("5th Level Color", DefaultValue = "BlueViolet", Group = "Schiff Pitchfork")]
        public Color FifthSchiffPitchforkColor { get; set; }

        [Parameter("5th Level Thickness", DefaultValue = 1, MinValue = 0, Group = "Schiff Pitchfork")]
        public int FifthSchiffPitchforkThickness { get; set; }

        [Parameter("5th Level Style", DefaultValue = LineStyle.Solid, Group = "Schiff Pitchfork")]
        public LineStyle FifthSchiffPitchforkStyle { get; set; }

        [Parameter("Show 6th Level", DefaultValue = true, Group = "Schiff Pitchfork")]
        public bool ShowSixthSchiffPitchfork { get; set; }

        [Parameter("6th Level Percent", DefaultValue = 1, Group = "Schiff Pitchfork")]
        public double SixthSchiffPitchforkPercent { get; set; }

        [Parameter("6th Level Color", DefaultValue = "AliceBlue", Group = "Schiff Pitchfork")]
        public Color SixthSchiffPitchforkColor { get; set; }

        [Parameter("6th Level Thickness", DefaultValue = 1, MinValue = 0, Group = "Schiff Pitchfork")]
        public int SixthSchiffPitchforkThickness { get; set; }

        [Parameter("6th Level Style", DefaultValue = LineStyle.Solid, Group = "Schiff Pitchfork")]
        public LineStyle SixthSchiffPitchforkStyle { get; set; }

        [Parameter("Show 7th Level", DefaultValue = true, Group = "Schiff Pitchfork")]
        public bool ShowSeventhSchiffPitchfork { get; set; }

        [Parameter("7th Level Percent", DefaultValue = 1.5, Group = "Schiff Pitchfork")]
        public double SeventhSchiffPitchforkPercent { get; set; }

        [Parameter("7th Level Color", DefaultValue = "Bisque", Group = "Schiff Pitchfork")]
        public Color SeventhSchiffPitchforkColor { get; set; }

        [Parameter("7th Level Thickness", DefaultValue = 1, MinValue = 0, Group = "Schiff Pitchfork")]
        public int SeventhSchiffPitchforkThickness { get; set; }

        [Parameter("7th Level Style", DefaultValue = LineStyle.Solid, Group = "Schiff Pitchfork")]
        public LineStyle SeventhSchiffPitchforkStyle { get; set; }

        [Parameter("Show 8th Level", DefaultValue = true, Group = "Schiff Pitchfork")]
        public bool ShowEighthSchiffPitchfork { get; set; }

        [Parameter("8th Level Percent", DefaultValue = 1.75, Group = "Schiff Pitchfork")]
        public double EighthSchiffPitchforkPercent { get; set; }

        [Parameter("8th Level Color", DefaultValue = "Azure", Group = "Schiff Pitchfork")]
        public Color EighthSchiffPitchforkColor { get; set; }

        [Parameter("8th Level Thickness", DefaultValue = 1, MinValue = 0, Group = "Schiff Pitchfork")]
        public int EighthSchiffPitchforkThickness { get; set; }

        [Parameter("8th Level Style", DefaultValue = LineStyle.Solid, Group = "Schiff Pitchfork")]
        public LineStyle EighthSchiffPitchforkStyle { get; set; }

        [Parameter("Show 9th Level", DefaultValue = true, Group = "Schiff Pitchfork")]
        public bool ShowNinthSchiffPitchfork { get; set; }

        [Parameter("9th Level Percent", DefaultValue = 2, Group = "Schiff Pitchfork")]
        public double NinthSchiffPitchforkPercent { get; set; }

        [Parameter("9th Level Color", DefaultValue = "Aqua", Group = "Schiff Pitchfork")]
        public Color NinthSchiffPitchforkColor { get; set; }

        [Parameter("9th Level Thickness", DefaultValue = 1, MinValue = 0, Group = "Schiff Pitchfork")]
        public int NinthSchiffPitchforkThickness { get; set; }

        [Parameter("9th Level Style", DefaultValue = LineStyle.Solid, Group = "Schiff Pitchfork")]
        public LineStyle NinthSchiffPitchforkStyle { get; set; }

        #endregion Schiff Pitchfork parameters

        #region Modified Schiff Pitchfork parameters

        [Parameter("Median Thickness", DefaultValue = 1, MinValue = 1, Group = "Modified Schiff Pitchfork")]
        public int ModifiedSchiffPitchforkMedianThickness { get; set; }

        [Parameter("Median Style", DefaultValue = LineStyle.Solid, Group = "Modified Schiff Pitchfork")]
        public LineStyle ModifiedSchiffPitchforkMedianStyle { get; set; }

        [Parameter("Median Color", DefaultValue = "Blue", Group = "Modified Schiff Pitchfork")]
        public Color ModifiedSchiffPitchforkMedianColor { get; set; }

        [Parameter("Show 1st Level", DefaultValue = true, Group = "Modified Schiff Pitchfork")]
        public bool ShowFirstModifiedSchiffPitchfork { get; set; }

        [Parameter("1st Level Percent", DefaultValue = 0.25, Group = "Modified Schiff Pitchfork")]
        public double FirstModifiedSchiffPitchforkPercent { get; set; }

        [Parameter("1st Level Color", DefaultValue = "Gray", Group = "Modified Schiff Pitchfork")]
        public Color FirstModifiedSchiffPitchforkColor { get; set; }

        [Parameter("1st Level Thickness", DefaultValue = 1, MinValue = 0, Group = "Modified Schiff Pitchfork")]
        public int FirstModifiedSchiffPitchforkThickness { get; set; }

        [Parameter("1st Level Style", DefaultValue = LineStyle.Solid, Group = "Modified Schiff Pitchfork")]
        public LineStyle FirstModifiedSchiffPitchforkStyle { get; set; }

        [Parameter("Show 2nd Level", DefaultValue = true, Group = "Modified Schiff Pitchfork")]
        public bool ShowSecondModifiedSchiffPitchfork { get; set; }

        [Parameter("2nd Level Percent", DefaultValue = 0.382, Group = "Modified Schiff Pitchfork")]
        public double SecondModifiedSchiffPitchforkPercent { get; set; }

        [Parameter("2nd Level Color", DefaultValue = "Red", Group = "Modified Schiff Pitchfork")]
        public Color SecondModifiedSchiffPitchforkColor { get; set; }

        [Parameter("2nd Level Thickness", DefaultValue = 1, MinValue = 0, Group = "Modified Schiff Pitchfork")]
        public int SecondModifiedSchiffPitchforkThickness { get; set; }

        [Parameter("2nd Level Style", DefaultValue = LineStyle.Solid, Group = "Modified Schiff Pitchfork")]
        public LineStyle SecondModifiedSchiffPitchforkStyle { get; set; }

        [Parameter("Show 3rd Level", DefaultValue = true, Group = "Modified Schiff Pitchfork")]
        public bool ShowThirdModifiedSchiffPitchfork { get; set; }

        [Parameter("3rd Level Percent", DefaultValue = 0.5, Group = "Modified Schiff Pitchfork")]
        public double ThirdModifiedSchiffPitchforkPercent { get; set; }

        [Parameter("3rd Level Color", DefaultValue = "GreenYellow", Group = "Modified Schiff Pitchfork")]
        public Color ThirdModifiedSchiffPitchforkColor { get; set; }

        [Parameter("3rd Level Thickness", DefaultValue = 1, MinValue = 0, Group = "Modified Schiff Pitchfork")]
        public int ThirdModifiedSchiffPitchforkThickness { get; set; }

        [Parameter("3rd Level Style", DefaultValue = LineStyle.Solid, Group = "Modified Schiff Pitchfork")]
        public LineStyle ThirdModifiedSchiffPitchforkStyle { get; set; }

        [Parameter("Show 4th Level", DefaultValue = true, Group = "Modified Schiff Pitchfork")]
        public bool ShowFourthModifiedSchiffPitchfork { get; set; }

        [Parameter("4th Level Percent", DefaultValue = 0.618, Group = "Modified Schiff Pitchfork")]
        public double FourthModifiedSchiffPitchforkPercent { get; set; }

        [Parameter("4th Level Color", DefaultValue = "DarkGreen", Group = "Modified Schiff Pitchfork")]
        public Color FourthModifiedSchiffPitchforkColor { get; set; }

        [Parameter("4th Level Thickness", DefaultValue = 1, MinValue = 0, Group = "Modified Schiff Pitchfork")]
        public int FourthModifiedSchiffPitchforkThickness { get; set; }

        [Parameter("4th Level Style", DefaultValue = LineStyle.Solid, Group = "Modified Schiff Pitchfork")]
        public LineStyle FourthModifiedSchiffPitchforkStyle { get; set; }

        [Parameter("Show 5th Level", DefaultValue = true, Group = "Modified Schiff Pitchfork")]
        public bool ShowFifthModifiedSchiffPitchfork { get; set; }

        [Parameter("5th Level Percent", DefaultValue = 0.75, Group = "Modified Schiff Pitchfork")]
        public double FifthModifiedSchiffPitchforkPercent { get; set; }

        [Parameter("5th Level Color", DefaultValue = "BlueViolet", Group = "Modified Schiff Pitchfork")]
        public Color FifthModifiedSchiffPitchforkColor { get; set; }
        
        [Parameter("5th Level Thickness", DefaultValue = 1, MinValue = 0, Group = "Modified Schiff Pitchfork")]
        public int FifthModifiedSchiffPitchforkThickness { get; set; }

        [Parameter("5th Level Style", DefaultValue = LineStyle.Solid, Group = "Modified Schiff Pitchfork")]
        public LineStyle FifthModifiedSchiffPitchforkStyle { get; set; }

        [Parameter("Show 6th Level", DefaultValue = true, Group = "Modified Schiff Pitchfork")]
        public bool ShowSixthModifiedSchiffPitchfork { get; set; }

        [Parameter("6th Level Percent", DefaultValue = 1, Group = "Modified Schiff Pitchfork")]
        public double SixthModifiedSchiffPitchforkPercent { get; set; }

        [Parameter("6th Level Color", DefaultValue = "AliceBlue", Group = "Modified Schiff Pitchfork")]
        public Color SixthModifiedSchiffPitchforkColor { get; set; }

        [Parameter("6th Level Thickness", DefaultValue = 1, MinValue = 0, Group = "Modified Schiff Pitchfork")]
        public int SixthModifiedSchiffPitchforkThickness { get; set; }

        [Parameter("6th Level Style", DefaultValue = LineStyle.Solid, Group = "Modified Schiff Pitchfork")]
        public LineStyle SixthModifiedSchiffPitchforkStyle { get; set; }

        [Parameter("Show 7th Level", DefaultValue = true, Group = "Modified Schiff Pitchfork")]
        public bool ShowSeventhModifiedSchiffPitchfork { get; set; }

        [Parameter("7th Level Percent", DefaultValue = 1.5, Group = "Modified Schiff Pitchfork")]
        public double SeventhModifiedSchiffPitchforkPercent { get; set; }

        [Parameter("7th Level Color", DefaultValue = "Bisque", Group = "Modified Schiff Pitchfork")]
        public Color SeventhModifiedSchiffPitchforkColor { get; set; }

        [Parameter("7th Level Thickness", DefaultValue = 1, MinValue = 0, Group = "Modified Schiff Pitchfork")]
        public int SeventhModifiedSchiffPitchforkThickness { get; set; }

        [Parameter("7th Level Style", DefaultValue = LineStyle.Solid, Group = "Modified Schiff Pitchfork")]
        public LineStyle SeventhModifiedSchiffPitchforkStyle { get; set; }

        [Parameter("Show 8th Level", DefaultValue = true, Group = "Modified Schiff Pitchfork")]
        public bool ShowEighthModifiedSchiffPitchfork { get; set; }

        [Parameter("8th Level Percent", DefaultValue = 1.75, Group = "Modified Schiff Pitchfork")]
        public double EighthModifiedSchiffPitchforkPercent { get; set; }

        [Parameter("8th Level Color", DefaultValue = "Azure", Group = "Modified Schiff Pitchfork")]
        public Color EighthModifiedSchiffPitchforkColor { get; set; }

        [Parameter("8th Level Thickness", DefaultValue = 1, MinValue = 0, Group = "Modified Schiff Pitchfork")]
        public int EighthModifiedSchiffPitchforkThickness { get; set; }

        [Parameter("8th Level Style", DefaultValue = LineStyle.Solid, Group = "Modified Schiff Pitchfork")]
        public LineStyle EighthModifiedSchiffPitchforkStyle { get; set; }

        [Parameter("Show 9th Level", DefaultValue = true, Group = "Modified Schiff Pitchfork")]
        public bool ShowNinthModifiedSchiffPitchfork { get; set; }

        [Parameter("9th Level Percent", DefaultValue = 2, Group = "Modified Schiff Pitchfork")]
        public double NinthModifiedSchiffPitchforkPercent { get; set; }

        [Parameter("9th Level Color", DefaultValue = "Aqua", Group = "Modified Schiff Pitchfork")]
        public Color NinthModifiedSchiffPitchforkColor { get; set; }

        [Parameter("9th Level Thickness", DefaultValue = 1, MinValue = 0, Group = "Modified Schiff Pitchfork")]
        public int NinthModifiedSchiffPitchforkThickness { get; set; }

        [Parameter("9th Level Style", DefaultValue = LineStyle.Solid, Group = "Modified Schiff Pitchfork")]
        public LineStyle NinthModifiedSchiffPitchforkStyle { get; set; }

        #endregion Modified Schiff Pitchfork parameters

        #region Pitchfan parameters

        [Parameter("Median Thickness", DefaultValue = 1, MinValue = 1, Group = "Pitchfan")]
        public int PitchfanMedianThickness { get; set; }

        [Parameter("Median Style", DefaultValue = LineStyle.Solid, Group = "Pitchfan")]
        public LineStyle PitchfanMedianStyle { get; set; }

        [Parameter("Median Color", DefaultValue = "Blue", Group = "Pitchfan")]
        public Color PitchfanMedianColor { get; set; }

        [Parameter("Show 1st Level", DefaultValue = true, Group = "Pitchfan")]
        public bool ShowFirstPitchfan { get; set; }

        [Parameter("1st Level Percent", DefaultValue = 0.25, Group = "Pitchfan")]
        public double FirstPitchfanPercent { get; set; }

        [Parameter("1st Level Color", DefaultValue = "Gray", Group = "Pitchfan")]
        public Color FirstPitchfanColor { get; set; }
        
        [Parameter("1st Level Thickness", DefaultValue = 1, MinValue = 0, Group = "Pitchfan")]
        public int FirstPitchfanThickness { get; set; }

        [Parameter("1st Level Style", DefaultValue = LineStyle.Solid, Group = "Pitchfan")]
        public LineStyle FirstPitchfanStyle { get; set; }

        [Parameter("Show 2nd Level", DefaultValue = true, Group = "Pitchfan")]
        public bool ShowSecondPitchfan { get; set; }

        [Parameter("2nd Level Percent", DefaultValue = 0.382, Group = "Pitchfan")]
        public double SecondPitchfanPercent { get; set; }

        [Parameter("2nd Level Color", DefaultValue = "Red", Group = "Pitchfan")]
        public Color SecondPitchfanColor { get; set; }

        [Parameter("2nd Level Thickness", DefaultValue = 1, MinValue = 0, Group = "Pitchfan")]
        public int SecondPitchfanThickness { get; set; }

        [Parameter("2nd Level Style", DefaultValue = LineStyle.Solid, Group = "Pitchfan")]
        public LineStyle SecondPitchfanStyle { get; set; }

        [Parameter("Show 3rd Level", DefaultValue = true, Group = "Pitchfan")]
        public bool ShowThirdPitchfan { get; set; }

        [Parameter("3rd Level Percent", DefaultValue = 0.5, Group = "Pitchfan")]
        public double ThirdPitchfanPercent { get; set; }

        [Parameter("3rd Level Color", DefaultValue = "GreenYellow", Group = "Pitchfan")]
        public Color ThirdPitchfanColor { get; set; }

        [Parameter("3rd Level Thickness", DefaultValue = 1, MinValue = 0, Group = "Pitchfan")]
        public int ThirdPitchfanThickness { get; set; }

        [Parameter("3rd Level Style", DefaultValue = LineStyle.Solid, Group = "Pitchfan")]
        public LineStyle ThirdPitchfanStyle { get; set; }

        [Parameter("Show 4th Level", DefaultValue = true, Group = "Pitchfan")]
        public bool ShowFourthPitchfan { get; set; }

        [Parameter("4th Level Percent", DefaultValue = 0.618, Group = "Pitchfan")]
        public double FourthPitchfanPercent { get; set; }

        [Parameter("4th Level Color", DefaultValue = "DarkGreen", Group = "Pitchfan")]
        public Color FourthPitchfanColor { get; set; }

        [Parameter("4th Level Thickness", DefaultValue = 1, MinValue = 0, Group = "Pitchfan")]
        public int FourthPitchfanThickness { get; set; }

        [Parameter("4th Level Style", DefaultValue = LineStyle.Solid, Group = "Pitchfan")]
        public LineStyle FourthPitchfanStyle { get; set; }

        [Parameter("Show 5th Level", DefaultValue = true, Group = "Pitchfan")]
        public bool ShowFifthPitchfan { get; set; }

        [Parameter("5th Level Percent", DefaultValue = 0.75, Group = "Pitchfan")]
        public double FifthPitchfanPercent { get; set; }

        [Parameter("5th Level Color", DefaultValue = "BlueViolet", Group = "Pitchfan")]
        public Color FifthPitchfanColor { get; set; }

        [Parameter("5th Level Thickness", DefaultValue = 1, MinValue = 0, Group = "Pitchfan")]
        public int FifthPitchfanThickness { get; set; }

        [Parameter("5th Level Style", DefaultValue = LineStyle.Solid, Group = "Pitchfan")]
        public LineStyle FifthPitchfanStyle { get; set; }

        [Parameter("Show 6th Level", DefaultValue = true, Group = "Pitchfan")]
        public bool ShowSixthPitchfan { get; set; }

        [Parameter("6th Level Percent", DefaultValue = 1, Group = "Pitchfan")]
        public double SixthPitchfanPercent { get; set; }

        [Parameter("6th Level Color", DefaultValue = "AliceBlue", Group = "Pitchfan")]
        public Color SixthPitchfanColor { get; set; }

        [Parameter("6th Level Thickness", DefaultValue = 1, MinValue = 0, Group = "Pitchfan")]
        public int SixthPitchfanThickness { get; set; }

        [Parameter("6th Level Style", DefaultValue = LineStyle.Solid, Group = "Pitchfan")]
        public LineStyle SixthPitchfanStyle { get; set; }

        [Parameter("Show 7th Level", DefaultValue = true, Group = "Pitchfan")]
        public bool ShowSeventhPitchfan { get; set; }

        [Parameter("7th Level Percent", DefaultValue = 1.5, Group = "Pitchfan")]
        public double SeventhPitchfanPercent { get; set; }

        [Parameter("7th Level Color", DefaultValue = "Bisque", Group = "Pitchfan")]
        public Color SeventhPitchfanColor { get; set; }

        [Parameter("7th Level Thickness", DefaultValue = 1, MinValue = 0, Group = "Pitchfan")]
        public int SeventhPitchfanThickness { get; set; }

        [Parameter("7th Level Style", DefaultValue = LineStyle.Solid, Group = "Pitchfan")]
        public LineStyle SeventhPitchfanStyle { get; set; }

        [Parameter("Show 8th Level", DefaultValue = true, Group = "Pitchfan")]
        public bool ShowEighthPitchfan { get; set; }

        [Parameter("8th Level Percent", DefaultValue = 1.75, Group = "Pitchfan")]
        public double EighthPitchfanPercent { get; set; }

        [Parameter("8th Level Color", DefaultValue = "Azure", Group = "Pitchfan")]
        public Color EighthPitchfanColor { get; set; }

        [Parameter("8th Level Thickness", DefaultValue = 1, MinValue = 0, Group = "Pitchfan")]
        public int EighthPitchfanThickness { get; set; }

        [Parameter("8th Level Style", DefaultValue = LineStyle.Solid, Group = "Pitchfan")]
        public LineStyle EighthPitchfanStyle { get; set; }

        [Parameter("Show 9th Level", DefaultValue = true, Group = "Pitchfan")]
        public bool ShowNinthPitchfan { get; set; }

        [Parameter("9th Level Percent", DefaultValue = 2, Group = "Pitchfan")]
        public double NinthPitchfanPercent { get; set; }

        [Parameter("9th Level Color", DefaultValue = "Aqua", Group = "Pitchfan")]
        public Color NinthPitchfanColor { get; set; }

        [Parameter("9th Level Thickness", DefaultValue = 1, MinValue = 0, Group = "Pitchfan")]
        public int NinthPitchfanThickness { get; set; }

        [Parameter("9th Level Style", DefaultValue = LineStyle.Solid, Group = "Pitchfan")]
        public LineStyle NinthPitchfanStyle { get; set; }

        #endregion Pitchfan parameters

        #region Overridden methods

        protected override void Initialize()
        {
            _mainPanel = new StackPanel
            {
                HorizontalAlignment = PanelHorizontalAlignment,
                VerticalAlignment = PanelVerticalAlignment,
                Orientation = PanelOrientation == Orientation.Horizontal ? Orientation.Vertical : Orientation.Horizontal,
                BackgroundColor = Color.Transparent,
            };

            _mainButtonsPanel = new StackPanel
            {
                Orientation = PanelOrientation,
                Margin = PanelMargin
            };

            _mainPanel.AddChild(_mainButtonsPanel);

            _groupButtonsPanel = new StackPanel
            {
                Orientation = PanelOrientation,
                Margin = PanelMargin,
                IsVisible = false
            };

            _mainPanel.AddChild(_groupButtonsPanel);
            
            _buttonsStyle = new Style();

            _buttonsStyle.Set(ControlProperty.Margin, ButtonsMargin);
            _buttonsStyle.Set(ControlProperty.BackgroundColor, ButtonsBackgroundDisableColor);
            _buttonsStyle.Set(ControlProperty.ForegroundColor, ButtonsForegroundColor);
            _buttonsStyle.Set(ControlProperty.HorizontalContentAlignment, HorizontalAlignment.Center);
            _buttonsStyle.Set(ControlProperty.VerticalContentAlignment, VerticalAlignment.Center);
            _buttonsStyle.Set(ControlProperty.Opacity, ButtonsTransparency);
            
            var patternConfig = new PatternConfig(Chart, PatternsColor, PatternsLabelShow,
                PatternsLabelColor, PatternsLabelLocked, PatternsLabelLinkStyle,
                new Logger(GetType().Name, Print));

            _expandButton = new Button
            {
                Style = _buttonsStyle,
                Text = "Expand Patterns"
            };

            _expandButton.Click += ExpandButton_Click;

            _mainButtonsPanel.AddChild(_expandButton);

            AddPatternButton(new OriginalPitchforkPattern(patternConfig, new LineSettings
            {
                LineColor = OriginalPitchforkMedianColor,
                Style = OriginalPitchforkMedianStyle,
                Thickness = OriginalPitchforkMedianThickness
            }, GetOriginalPitchforkLevels()));
            AddPatternButton(new SchiffPitchforkPattern(patternConfig, new LineSettings
            {
                LineColor = SchiffPitchforkMedianColor,
                Style = SchiffPitchforkMedianStyle,
                Thickness = SchiffPitchforkMedianThickness
            }, GetSchiffPitchforkLevels()));
            AddPatternButton(new ModifiedSchiffPitchforkPattern(patternConfig, new LineSettings
            {
                LineColor = ModifiedSchiffPitchforkMedianColor,
                Style = ModifiedSchiffPitchforkMedianStyle,
                Thickness = ModifiedSchiffPitchforkMedianThickness
            }, GetModifiedSchiffPitchforkLevels()));
            AddPatternButton(new PitchfanPattern(patternConfig, GetPitchfanSideFanSettings(), new FanSettings
            {
                Color = PitchfanMedianColor,
                Style = PitchfanMedianStyle,
                Thickness = PitchfanMedianThickness
            }));

            var showHideButton = new Controls.ToggleButton()
            {
                Style = _buttonsStyle,
                OnColor = ButtonsBackgroundEnableColor,
                OffColor = ButtonsBackgroundDisableColor,
                Text = "Hide",
                IsVisible = false
            };

            showHideButton.TurnedOn += ShowHideButton_TurnedOn;
            showHideButton.TurnedOff += ShowHideButton_TurnedOff;

            _mainButtonsPanel.AddChild(showHideButton);
            _buttons.Add(showHideButton);

            var saveButton = new PatternsSaveButton(Chart)
            {
                Style = _buttonsStyle,
                IsVisible = false
            };

            _mainButtonsPanel.AddChild(saveButton);
            _buttons.Add(saveButton);

            var loadButton = new PatternsLoadButton(Chart)
            {
                Style = _buttonsStyle,
                IsVisible = false
            };

            _mainButtonsPanel.AddChild(loadButton);
            _buttons.Add(loadButton);

            var removeAllButton = new PatternsRemoveAllButton(Chart)
            {
                Style = _buttonsStyle,
                IsVisible = false
            };

            _mainButtonsPanel.AddChild(removeAllButton);
            _buttons.Add(removeAllButton);

            var collapseButton = new Button
            {
                Style = _buttonsStyle,
                Text = "Collapse",
                IsVisible = false
            };

            collapseButton.Click += CollapseButton_Click;

            _mainButtonsPanel.AddChild(collapseButton);
            _buttons.Add(collapseButton);

            Chart.AddControl(_mainPanel);

            CheckTimeFrameVisibility();
        }

        public override void Calculate(int index)
        {
        }

        #endregion Overridden methods

        private void CollapseButton_Click(ButtonClickEventArgs obj)
        {
            _buttons.ForEach(iButton => iButton.IsVisible = false);

            _groupButtonsPanel.IsVisible = false;

            _expandButton.IsVisible = true;
        }

        private void ExpandButton_Click(ButtonClickEventArgs obj)
        {
            _buttons.ForEach(iButton => iButton.IsVisible = true);

            obj.Button.IsVisible = false;
        }

        private void ShowHideButton_TurnedOff(Controls.ToggleButton obj)
        {
            Chart.ChangePatternsVisibility(false);

            obj.Text = "Hide";
        }

        private void ShowHideButton_TurnedOn(Controls.ToggleButton obj)
        {
            Chart.ChangePatternsVisibility(true);

            obj.Text = "Show";
        }

        private void AddPatternButton(IPattern pattern)
        {
            var button = new PatternButton(pattern)
            {
                Style = _buttonsStyle,
                OnColor = ButtonsBackgroundEnableColor,
                OffColor = ButtonsBackgroundDisableColor,
                IsVisible = false
            };

            _buttons.Add(button);

            _mainButtonsPanel.AddChild(button);

            pattern.Initialize();
        }

        private void CheckTimeFrameVisibility()
        {
            if (IsTimeFrameVisibilityEnabled)
            {
                if (TimeFrame != VisibilityTimeFrame)
                {
                    _mainButtonsPanel.IsVisible = false;

                    if (!VisibilityOnlyButtons) Chart.ChangePatternsVisibility(true);
                }
                else if (!VisibilityOnlyButtons)
                {
                    Chart.ChangePatternsVisibility(false);
                }
            }
        }

        private Dictionary<double, PercentLineSettings> GetOriginalPitchforkLevels()
        {
            var originalPitchforkLevels = new Dictionary<double, PercentLineSettings>();

            if (ShowFirstOriginalPitchfork)
            {
                originalPitchforkLevels.Add(FirstOriginalPitchforkPercent, new PercentLineSettings
                {
                    Percent = FirstOriginalPitchforkPercent,
                    LineColor = FirstOriginalPitchforkColor,
                    Style = FirstOriginalPitchforkStyle,
                    Thickness = FirstOriginalPitchforkThickness,
                });
            }

            if (ShowSecondOriginalPitchfork)
            {
                originalPitchforkLevels.Add(SecondOriginalPitchforkPercent, new PercentLineSettings
                {
                    Percent = SecondOriginalPitchforkPercent,
                    LineColor = SecondOriginalPitchforkColor,
                    Style = SecondOriginalPitchforkStyle,
                    Thickness = SecondOriginalPitchforkThickness,
                });
            }

            if (ShowThirdOriginalPitchfork)
            {
                originalPitchforkLevels.Add(ThirdOriginalPitchforkPercent, new PercentLineSettings
                {
                    Percent = ThirdOriginalPitchforkPercent,
                    LineColor = ThirdOriginalPitchforkColor,
                    Style = ThirdOriginalPitchforkStyle,
                    Thickness = ThirdOriginalPitchforkThickness,
                });
            }

            if (ShowFourthOriginalPitchfork)
            {
                originalPitchforkLevels.Add(FourthOriginalPitchforkPercent, new PercentLineSettings
                {
                    Percent = FourthOriginalPitchforkPercent,
                    LineColor = FourthOriginalPitchforkColor,
                    Style = FourthOriginalPitchforkStyle,
                    Thickness = FourthOriginalPitchforkThickness,
                });
            }

            if (ShowFifthOriginalPitchfork)
            {
                originalPitchforkLevels.Add(FifthOriginalPitchforkPercent, new PercentLineSettings
                {
                    Percent = FifthOriginalPitchforkPercent,
                    LineColor = FifthOriginalPitchforkColor,
                    Style = FifthOriginalPitchforkStyle,
                    Thickness = FifthOriginalPitchforkThickness,
                });
            }

            if (ShowSixthOriginalPitchfork)
            {
                originalPitchforkLevels.Add(SixthOriginalPitchforkPercent, new PercentLineSettings
                {
                    Percent = SixthOriginalPitchforkPercent,
                    LineColor = SixthOriginalPitchforkColor,
                    Style = SixthOriginalPitchforkStyle,
                    Thickness = SixthOriginalPitchforkThickness,
                });
            }

            if (ShowSeventhOriginalPitchfork)
            {
                originalPitchforkLevels.Add(SeventhOriginalPitchforkPercent, new PercentLineSettings
                {
                    Percent = SeventhOriginalPitchforkPercent,
                    LineColor = SeventhOriginalPitchforkColor,
                    Style = SeventhOriginalPitchforkStyle,
                    Thickness = SeventhOriginalPitchforkThickness,
                });
            }

            if (ShowEighthOriginalPitchfork)
            {
                originalPitchforkLevels.Add(EighthOriginalPitchforkPercent, new PercentLineSettings
                {
                    Percent = EighthOriginalPitchforkPercent,
                    LineColor = EighthOriginalPitchforkColor,
                    Style = EighthOriginalPitchforkStyle,
                    Thickness = EighthOriginalPitchforkThickness,
                });
            }

            if (ShowNinthOriginalPitchfork)
            {
                originalPitchforkLevels.Add(NinthOriginalPitchforkPercent, new PercentLineSettings
                {
                    Percent = NinthOriginalPitchforkPercent,
                    LineColor = NinthOriginalPitchforkColor,
                    Style = NinthOriginalPitchforkStyle,
                    Thickness = NinthOriginalPitchforkThickness,
                });
            }

            return originalPitchforkLevels;
        }

        private Dictionary<double, PercentLineSettings> GetSchiffPitchforkLevels()
        {
            var schiffPitchforkLevels = new Dictionary<double, PercentLineSettings>();

            if (ShowFirstSchiffPitchfork)
            {
                schiffPitchforkLevels.Add(FirstSchiffPitchforkPercent, new PercentLineSettings
                {
                    Percent = FirstSchiffPitchforkPercent,
                    LineColor = FirstSchiffPitchforkColor,
                    Style = FirstSchiffPitchforkStyle,
                    Thickness = FirstSchiffPitchforkThickness,
                });
            }

            if (ShowSecondSchiffPitchfork)
            {
                schiffPitchforkLevels.Add(SecondSchiffPitchforkPercent, new PercentLineSettings
                {
                    Percent = SecondSchiffPitchforkPercent,
                    LineColor = SecondSchiffPitchforkColor,
                    Style = SecondSchiffPitchforkStyle,
                    Thickness = SecondSchiffPitchforkThickness,
                });
            }

            if (ShowThirdSchiffPitchfork)
            {
                schiffPitchforkLevels.Add(ThirdSchiffPitchforkPercent, new PercentLineSettings
                {
                    Percent = ThirdSchiffPitchforkPercent,
                    LineColor = ThirdSchiffPitchforkColor,
                    Style = ThirdSchiffPitchforkStyle,
                    Thickness = ThirdSchiffPitchforkThickness,
                });
            }

            if (ShowFourthSchiffPitchfork)
            {
                schiffPitchforkLevels.Add(FourthSchiffPitchforkPercent, new PercentLineSettings
                {
                    Percent = FourthSchiffPitchforkPercent,
                    LineColor = FourthSchiffPitchforkColor,
                    Style = FourthSchiffPitchforkStyle,
                    Thickness = FourthSchiffPitchforkThickness,
                });
            }

            if (ShowFifthSchiffPitchfork)
            {
                schiffPitchforkLevels.Add(FifthSchiffPitchforkPercent, new PercentLineSettings
                {
                    Percent = FifthSchiffPitchforkPercent,
                    LineColor = FifthSchiffPitchforkColor,
                    Style = FifthSchiffPitchforkStyle,
                    Thickness = FifthSchiffPitchforkThickness,
                });
            }

            if (ShowSixthSchiffPitchfork)
            {
                schiffPitchforkLevels.Add(SixthSchiffPitchforkPercent, new PercentLineSettings
                {
                    Percent = SixthSchiffPitchforkPercent,
                    LineColor = SixthSchiffPitchforkColor,
                    Style = SixthSchiffPitchforkStyle,
                    Thickness = SixthSchiffPitchforkThickness,
                });
            }

            if (ShowSeventhSchiffPitchfork)
            {
                schiffPitchforkLevels.Add(SeventhSchiffPitchforkPercent, new PercentLineSettings
                {
                    Percent = SeventhSchiffPitchforkPercent,
                    LineColor = SeventhSchiffPitchforkColor,
                    Style = SeventhSchiffPitchforkStyle,
                    Thickness = SeventhSchiffPitchforkThickness,
                });
            }

            if (ShowEighthSchiffPitchfork)
            {
                schiffPitchforkLevels.Add(EighthSchiffPitchforkPercent, new PercentLineSettings
                {
                    Percent = EighthSchiffPitchforkPercent,
                    LineColor = EighthSchiffPitchforkColor,
                    Style = EighthSchiffPitchforkStyle,
                    Thickness = EighthSchiffPitchforkThickness,
                });
            }

            if (ShowNinthSchiffPitchfork)
            {
                schiffPitchforkLevels.Add(NinthSchiffPitchforkPercent, new PercentLineSettings
                {
                    Percent = NinthSchiffPitchforkPercent,
                    LineColor = NinthSchiffPitchforkColor,
                    Style = NinthSchiffPitchforkStyle,
                    Thickness = NinthSchiffPitchforkThickness,
                });
            }

            return schiffPitchforkLevels;
        }

        private Dictionary<double, PercentLineSettings> GetModifiedSchiffPitchforkLevels()
        {
            var modifiedSchiffPitchforkLevels = new Dictionary<double, PercentLineSettings>();

            if (ShowFirstModifiedSchiffPitchfork)
            {
                modifiedSchiffPitchforkLevels.Add(FirstModifiedSchiffPitchforkPercent, new PercentLineSettings
                {
                    Percent = FirstModifiedSchiffPitchforkPercent,
                    LineColor = FirstModifiedSchiffPitchforkColor,
                    Style = FirstModifiedSchiffPitchforkStyle,
                    Thickness = FirstModifiedSchiffPitchforkThickness,
                });
            }

            if (ShowSecondModifiedSchiffPitchfork)
            {
                modifiedSchiffPitchforkLevels.Add(SecondModifiedSchiffPitchforkPercent, new PercentLineSettings
                {
                    Percent = SecondModifiedSchiffPitchforkPercent,
                    LineColor = SecondModifiedSchiffPitchforkColor,
                    Style = SecondModifiedSchiffPitchforkStyle,
                    Thickness = SecondModifiedSchiffPitchforkThickness,
                });
            }

            if (ShowThirdModifiedSchiffPitchfork)
            {
                modifiedSchiffPitchforkLevels.Add(ThirdModifiedSchiffPitchforkPercent, new PercentLineSettings
                {
                    Percent = ThirdModifiedSchiffPitchforkPercent,
                    LineColor = ThirdModifiedSchiffPitchforkColor,
                    Style = ThirdModifiedSchiffPitchforkStyle,
                    Thickness = ThirdModifiedSchiffPitchforkThickness,
                });
            }

            if (ShowFourthModifiedSchiffPitchfork)
            {
                modifiedSchiffPitchforkLevels.Add(FourthModifiedSchiffPitchforkPercent, new PercentLineSettings
                {
                    Percent = FourthModifiedSchiffPitchforkPercent,
                    LineColor = FourthModifiedSchiffPitchforkColor,
                    Style = FourthModifiedSchiffPitchforkStyle,
                    Thickness = FourthModifiedSchiffPitchforkThickness,
                });
            }

            if (ShowFifthModifiedSchiffPitchfork)
            {
                modifiedSchiffPitchforkLevels.Add(FifthModifiedSchiffPitchforkPercent, new PercentLineSettings
                {
                    Percent = FifthModifiedSchiffPitchforkPercent,
                    LineColor = FifthModifiedSchiffPitchforkColor,
                    Style = FifthModifiedSchiffPitchforkStyle,
                    Thickness = FifthModifiedSchiffPitchforkThickness,
                });
            }

            if (ShowSixthModifiedSchiffPitchfork)
            {
                modifiedSchiffPitchforkLevels.Add(SixthModifiedSchiffPitchforkPercent, new PercentLineSettings
                {
                    Percent = SixthModifiedSchiffPitchforkPercent,
                    LineColor = SixthModifiedSchiffPitchforkColor,
                    Style = SixthModifiedSchiffPitchforkStyle,
                    Thickness = SixthModifiedSchiffPitchforkThickness,
                });
            }

            if (ShowSeventhModifiedSchiffPitchfork)
            {
                modifiedSchiffPitchforkLevels.Add(SeventhModifiedSchiffPitchforkPercent, new PercentLineSettings
                {
                    Percent = SeventhModifiedSchiffPitchforkPercent,
                    LineColor = SeventhModifiedSchiffPitchforkColor,
                    Style = SeventhModifiedSchiffPitchforkStyle,
                    Thickness = SeventhModifiedSchiffPitchforkThickness,
                });
            }

            if (ShowEighthModifiedSchiffPitchfork)
            {
                modifiedSchiffPitchforkLevels.Add(EighthModifiedSchiffPitchforkPercent, new PercentLineSettings
                {
                    Percent = EighthModifiedSchiffPitchforkPercent,
                    LineColor = EighthModifiedSchiffPitchforkColor,
                    Style = EighthModifiedSchiffPitchforkStyle,
                    Thickness = EighthModifiedSchiffPitchforkThickness,
                });
            }

            if (ShowNinthModifiedSchiffPitchfork)
            {
                modifiedSchiffPitchforkLevels.Add(NinthModifiedSchiffPitchforkPercent, new PercentLineSettings
                {
                    Percent = NinthModifiedSchiffPitchforkPercent,
                    LineColor = NinthModifiedSchiffPitchforkColor,
                    Style = NinthModifiedSchiffPitchforkStyle,
                    Thickness = NinthModifiedSchiffPitchforkThickness,
                });
            }

            return modifiedSchiffPitchforkLevels;
        }

        private SideFanSettings[] GetPitchfanSideFanSettings()
        {
            var result = new List<SideFanSettings>();

            if (ShowFirstPitchfan)
            {
                result.Add(new SideFanSettings
                {
                    Percent = FirstPitchfanPercent,
                    Color = FirstPitchfanColor,
                    Style = FirstPitchfanStyle,
                    Thickness = FirstPitchfanThickness,
                });
            }

            if (ShowSecondPitchfan)
            {
                result.Add(new SideFanSettings
                {
                    Percent = SecondPitchfanPercent,
                    Color = SecondPitchfanColor,
                    Style = SecondPitchfanStyle,
                    Thickness = SecondPitchfanThickness,
                });
            }

            if (ShowThirdPitchfan)
            {
                result.Add(new SideFanSettings
                {
                    Percent = ThirdPitchfanPercent,
                    Color = ThirdPitchfanColor,
                    Style = ThirdPitchfanStyle,
                    Thickness = ThirdPitchfanThickness,
                });
            }

            if (ShowFourthPitchfan)
            {
                result.Add(new SideFanSettings
                {
                    Percent = FourthPitchfanPercent,
                    Color = FourthPitchfanColor,
                    Style = FourthPitchfanStyle,
                    Thickness = FourthPitchfanThickness,
                });
            }

            if (ShowFifthPitchfan)
            {
                result.Add(new SideFanSettings
                {
                    Percent = FifthPitchfanPercent,
                    Color = FifthPitchfanColor,
                    Style = FifthPitchfanStyle,
                    Thickness = FifthPitchfanThickness,
                });
            }

            if (ShowSixthPitchfan)
            {
                result.Add(new SideFanSettings
                {
                    Percent = SixthPitchfanPercent,
                    Color = SixthPitchfanColor,
                    Style = SixthPitchfanStyle,
                    Thickness = SixthPitchfanThickness,
                });
            }

            if (ShowSeventhPitchfan)
            {
                result.Add(new SideFanSettings
                {
                    Percent = SeventhPitchfanPercent,
                    Color = SeventhPitchfanColor,
                    Style = SeventhPitchfanStyle,
                    Thickness = SeventhPitchfanThickness,
                });
            }

            if (ShowEighthPitchfan)
            {
                result.Add(new SideFanSettings
                {
                    Percent = EighthPitchfanPercent,
                    Color = EighthPitchfanColor,
                    Style = EighthPitchfanStyle,
                    Thickness = EighthPitchfanThickness,
                });
            }

            if (ShowNinthPitchfan)
            {
                result.Add(new SideFanSettings
                {
                    Percent = NinthPitchfanPercent,
                    Color = NinthPitchfanColor,
                    Style = NinthPitchfanStyle,
                    Thickness = NinthPitchfanThickness,
                });
            }

            result.ToList().ForEach(iSettings => result.Add(new SideFanSettings
            {
                Percent = -iSettings.Percent,
                Color = iSettings.Color,
                Style = iSettings.Style,
                Thickness = iSettings.Thickness,
            }));

            return result.ToArray();
        }
    }
}

Spotware's avatar
Spotware

Joined on 23.09.2013

  • Distribution: Free
  • Language: C#
  • Trading platform: cTrader Automate
  • File name: Pitchfork Drawing.algo
  • Rating: 5
  • Installs: 1771
  • Modified: 26/01/2023 10:56
Comments
Log in to add a comment.
FA
faheem.noori · 9 months ago

Him just some feedback. You guys need to add more tools and update a little bit.

The Original, Modified & Schiff Pitchform you have created is wrong. They give completely wrong lines and readings compared to the original pitfork you have on the toolbar plus it gives off wrong readings compared to other trading platforms.

It would be appreciated if your team could look into this. Why is it that other platforms have these perfect but you guys are lagging. I like Ctrader but it would be a shame to move to another platform just because you guys cant add more tools that work rather than just making a bad one or just making one for the sake of making it.

artcfd's avatar
artcfd · 1 year ago

Feedback two questions, 1. The magnetic attraction function of this indicator has no effect when drawing a picture, and the magnetic attraction function can only return to normal after the drawing is completed. This is very troublesome to draw a picture, because the system's built-in indicator defaults to the magnetic attraction process during the drawing process. normal. 2. Sometimes the lines drawn by this indicator are not parallel, and I don't know why.

JA
jameceswilson · 2 years ago

The Pitchfork Drawing is a traditional design from the Appalachian region. It is a type of weaving pattern which resembles the pitchfork with a bow. We have providing best book writing services in UK and get 30%.

UZ
uzairmaster97 · 3 years ago

This indicator has a big issue. Sometimes the lines drawn are not parallel to each other.

prlozc's avatar
prlozc · 3 years ago

Hello I have a problem.

Usually to test source code from other people I copy the code, create a new indicator, paste it and run a new instance in a random pair.

When I do this I got a lot of errors saying at the end "(are you missing a using directive or an assembly reference?)"

But if I download and double click and install, it works.

 

Why is this happening if both sorce codes are the same?

Thanks