The Trend Chart Styles extension includes the following new chart styles for Quantacula Studio:
Additionally, the extension contains building block conditions and indicators that can be used both in Quantacula Studio, and the Quantacula web site. For those of you who code your models in the C# programming language, the extension includes .NET classes that let you programmatically create and interrogate the chart styles listed above. If you use these classes, be sure to add using TrendChartStyles; along with your other using statements.
All the chart styles in this extension display with a non-uniform date axis. They rely on reversals to determine when to plot the next data on the chart. Therefore, each piece of data plotted may comprise many actual bars of historical data.
Kagi charts display price movement in a series of variable length vertical lines connected by short horizontal lines. A new vertical line is drawn when prices complete a reversal based on a percentage or point value that you specify in the configuration. Kagi charts can be based off closing price, or highs and lows.
Kagi also includes the concept of Yin/Yang. When prices penetrate the previous reversal high, they enter Yang territory, and are plotted with a thick line. Alternately, when prices cross below the previous reversal low, they enter Yin territory, and are plotted with a thin line.
These items can be used both in Quantacula Studio, and in Q-Web here on the Quantacula.com web site. The Kagi Reversal building block condition resolves to true if a Kagi reversal was detected on the bar being evaluated. The KagiYinYang indicator resolved to 1 if a bar is in Kagi Yang territory, and a 0 if it is in Yin territory.
Create an instance of the Kagi class to work with Kagi methods in your C# coded models. Use the following constructor format:
public Kagi(BarHistory bars, SourceData kagiSource, ReversalTypes kagiRevType, double revAmount)
SourceData = CloseOnly or HighsAndLows.
ReversalTypes = Value (point value) or Percent.
Once you have an instance of the Kagi class created, you can access its properties and methods.
public List<KagiEvent> Events
Returns a list of KagiEvent instances that represent the Kagi reversals in the source data. The KagiEvent class contains the following properties:
public KagiEvent EventAt(int idx)
Returns the KagiEvent that occurred on the specified bar, or null if no event occurred at that bar.
public TimeSeries YinYangSeries
Line break charts display price action using a series of boxes called lines. If prices continue in one direction, new lines are added in that direction. A new line in the opposite direction will be added only if a previous number of lines are penetrated. The number of lines to penetrate is configurable, with a default value of three. For example, in a downtrend, a new upside reversal line will be plotted only if prices penetrate the high of the previous three downside lines.
The Line Break Reversal building block condition resolves to true if a Line Break reversal occurred on the bar of data being evaluated. The LineBreakCount indicator contains the number of consecutive up or down lines. Up lines are represented by positive values, and down lines by negative values. The LineBreakValue indicator returns the value needed to penetrate the most recent N lines, configurable via parameter. You can use this indicator as a stop value for an entry trade, to simulate the Line Break trading method in a trading model.
Create an instance of the LineBreak class to work with Line Break methods in your C# coded models. Use the following constructor to create an instance of the LineBreak class:
public LineBreak(BarHistory bh, int lineCount)
Once created, you can access the following properties and methods of the class.
public List<LineBreakLine> Lines
Returns a list of LineBreakLine objects that represent the lines on the Line Break chart. The LineBreakLine class has the following properties:
public LineBreakLine LineAt(int idx)
Returns the LineBreakLine instance at the specified index into the source data. If no LineBreakLine exists at that index, returns null.
public TimeSeries LineCounts
Returns a TimeSeries that contains the number of running line counts (positive for upside lines, negative for downside lines) as of each bar in the source data. This is the TimeSeries used to populate the LineBreakCount indicator.
public TimeSeries GetBreakoutSeries(BarHistory bars, int lineCount, bool basedOnHighs)
Returns a TimeSeries that contains the highest (if basedOnHighs = true) or lowest (if basedOnHighs = false) value of the previous lineCount lines. This method is used to populate the LineBreakValue indicator.
Point & Figure charts are displayed as a series of columns of X's and O'x. Columns with X's represent rising prices, and columns with O's indicate falling prices. The symbols plotted on a Point & Figure chart are called boxes. New boxes are added only if prices move by a certain, configurable, amount.
Point & Figure boxes can be calculated based on closing prices only, or on highs and lows. They can also be based on either a fixed point value, or a percentage. You configure both the box size, and the reversal count, which indicates how many boxes in the opposite direction need to occur for a reversal to actually plot.
If you select the Traditional box type, this overrides the calculation and box size settings, and establishes a Point & Figure chart based on point values, using the highest data value in the chart history. The following table is used to determine the box size. This method is not recommended for backtesting, because the full range of data is used to determine the dynamic box size, so this introduces an element of look-ahead.
|Highest High||Box Size|
The Point & Figure Reversal building block condition resolves to true if there is a Point & Figure reversal on the bar of data being processed. The PFBoxCount indicator returns a series of values that contain the running total up X boxes (positive values) and O boxes (negative values) in the source data.
Create an instance of the PointAndFigure .NET class to work with Point & Figure concepts in your C# coded models. Use the following constructor to create a PointAndFigure instance:
public PointAndFigure(BarHistory bars, SourceData pfMethod, PointAndFigureBoxTypes pfBoxType, double boxSize, int boxCount)
SourceData = CloseOnly or HighsAndLows
PointAndFigureBoxTypes = Traditional, Fixed or Point
After creating the PointAndFigure instance, you can access its properties and methods, described below.
public List<PointAndFigureColumn> Columns
Returns a list of PointAndFigureColumn objects that represent the columns in the Point & Figure chart. The PointAndFigureColumn class has the following properties:
public PointAndFigureColumn ColumnAt(int idx)
Returns the PointAndFigureColumn at the specified index in the source data, or null if one was not found.
public List<PointAndFigureEvent> Events
Returns a list of PointAndFigureEvent objects that represent the reversals that occurred in the Point & Figure chart. The PointAndFigureEvent class has the following properties:
public PointAndFigureEvent EventAt(int idx)
Returns the PointAndFigureEvent* at the specified index in the source data, or null if one was not found.
public TimeSeries RunningTotals
Returns a TimeSeries that contains the running total of rising X (positive values) boxes and falling O (negative values) boxes. This is the property used to populate the PFBoxCount indicator.
Renko charts use bricks, or boxes, to display price movement. A new box is drawn whenever price moves more than a predetermined interval either up or down. This means that a single bar on a normal chart can result in many boxes being drawn on a Renko chart. For example, if the Renko box size is $1, and price moves $3 up in one trading day, 3 Renko boxes are drawn on the chart. You control the Renko box size in chart preferences. As you can see below, the Renko boxes can be based off closing price only, or off highs and lows.
The Renko Reversal building block condition resolves to true if there was a Renko reversal on the bar of data being processed. The RenkoBoxCount indicator displays the running total of Renko boxes, using positive values for up boxes and negative values for down boxes.
Create an instance of the Renko .NET class to work with Renko charting methods in your C# coded models. The Renko class uses the following constructor format:
public Renko(BarHistory bh, SourceData source, double boxSize)
SourceData = CloseOnly or HighsAndLows
Once you create the Renko instance, you can access its properties, described below.
public List<RenkoEvent> Events
Returns a list of RenkoEvent object instances that represent the turning points in the Renko chart. The RenkoEvent class has the following properties:
public RenkoEvent EventAt(int idx)
Returns the RenkoEvent that occurred at the specified bar, or null if no event occurred on that bar.
public TimeSeries Boxes
Returns a TimeSeries that contains the number of Renko boxes for each bar of data on the chart. The value for a particular bar may be zero if no Renko boxes were drawn for that bar, or a positive value if up boxes were drawn, or a negative value if down boxes were drawn.
public TimeSeries RunningTotals
Returns a TimeSeries that contains the running total of Renko boxes as of each bar of data on the chart. If the current state of the Renko chart is up, then the value will be positive, and if it is down the value will be negative. This property is used to populate the RenkoBoxCount indicator.