Visualizing the Chikou Span Using DRAWSEGMENT in ProBuilder

05 Sep 2024
0 comment
0 attachment

The following ProBuilder code snippet demonstrates how to visualize the Chikou Span of the Ichimoku Kinko Hyo indicator by plotting it 26 periods in the past using the `DRAWSEGMENT` function. This approach is useful for those looking to incorporate visual elements of the Ichimoku system in their chart analysis without future plotting capabilities.

drawsegment(barindex[26], close, barindex[27], close[1]) coloured(139,69,19,255)

Explanation of the Code:

  • drawsegment: This function is used to draw a line segment between two points on the chart. It is particularly useful for custom visualizations where standard plotting functions are limited to current and future values.
  • barindex[26]: This represents the bar index 26 periods ago. In ProBuilder, barindex is an array containing the indices of each bar on the chart.
  • close: This is the closing price of the current bar. In the context of the Chikou Span, this value is plotted 26 periods in the past.
  • barindex[27]: This is the bar index 27 periods ago, providing the starting point for the next segment.
  • close[1]: This represents the closing price of the previous bar (one period before the current bar).
  • coloured(139,69,19,255): This function sets the color of the drawn segment. The values (139,69,19,255) represent an RGBA color code, where R=139, G=69, B=19, and A=255 (full opacity).

This method of plotting the Chikou Span is particularly useful for visual backtesting and analysis, allowing traders to see how the Chikou Span interacted with the price 26 periods ago, which is a critical aspect of the Ichimoku Kinko Hyo trading system.

Related Post

Check out this related content for more information:

https://www.prorealcode.com/topic/writing-the-ichimoku-indicator/page/2/#post-94712

Visit Link
What is a Snippet? A snippet is a small, reusable chunk of code designed to solve specific tasks quickly. Think of it as a shortcut that helps you achieve your coding goals without reinventing the wheel. How to Use: Simply copy the snippet and paste it into your project where needed. Don't forget to tweak it to fit your context. Snippets are not just time-savers; they're also learning tools to help you become a more efficient coder.
robertogozzi Master
Roberto https://www.ots-onlinetradingsoftware.com
Author’s Profile

Comments

Search Snippets

Showing some results...
Sorry, no result found!

Snippets Categories

global
35
indicator
133
strategy
171

Recent Snippets

How to Create a Simple MTF Trend Dashboard with EMA and SMA
indicator
This indicator builds a compact multi-timeframe (MTF) dashboard that shows whether price is trading above or below a [...]
How to Display Per-Bar Volume Accumulation in Real Time (Intrabar Updates)
global
This snippet tracks and displays the current bar’s accumulated volume while the bar is still forming, instead of only [...]
Ticks Counter: Count Tick Updates Per Bar on Tick or Time Charts
global
This snippet counts how many tick updates have occurred for the current bar by incrementing a per-bar counter on each [...]
How to Build a Step-Based Trailing Stop That Moves to Break-Even First
strategy
This snippet implements a step trailing stop that advances in fixed increments once price reaches predefined profit [...]
Utilizing Arrays to Track and Compare Indicator Values Within the Same Bar in ProBuilder
indicator
This ProBuilder code snippet demonstrates how to use arrays to compare the values of an indicator (RSI in this case) [...]
Logo Logo
Loading...