Ichimoku
Author: ayc868
Creation Date: 3/31/2009 10:47 PM
profile picture

ayc868

#1

do not find code in WL5, anyone know where I can find it?
profile picture

Eugene

#2
Download Community.Indicators from this site.
profile picture

ayc868

#3

I have it. it only show two lines with other name.
it does not show as "Ichimoku". I do not see the cloud and other lines.


profile picture

ayc868

#4

only Senkou Span A & B ?
profile picture

Eugene

#5
It shows Senkou Span A and Senkou Span B. Since they are designed to be plotted alongside each other, you'll get the cloud by picking any of these two and selecting "Plot both indicator bands" + "Fill the bands".
profile picture

Eugene

#6
profile picture

ayc868

#7

It will be appreciated if we can have a turn key indicator. it may be easy for you, but will take a while for
me to do it right. :)
profile picture

Eugene

#8
And even though including one-liners to Community.Indicators isn't our rule, adding the other Ichimoku components makes sense to me.
profile picture

Cone

#9
I thought I had used Ichimoku as an example in the WealthScript Guide, but here it is anyway -

CODE:
Please log in to see this code.
profile picture

Eugene

#10
ayc868

4 Ichimoku indicators now available in Community.Indicators: the Tenkan Sen, Kijun Sen, Senkou Span A and Senkou Span B. Grab the library or use the EM tool to update.
profile picture

SBondorowicz

#11
In the example above the two span lines are offset with >> p4 which I thought shifted the series back 26 days. It was my understanding that Ichimoku charts projected these two span lines forward by 26 days which would be << p4 but when I try this the span lines fall to the bottom of the chart.
profile picture

Cone

#12
The shift "back" operator, <<, has almost no practical use. It shifts series data from the future to the past. So, when you move data from 26 days in the future to the past, guess what? The data are zero, because it doesn't exist yet.

The shift forward operation, >>, is a "delay". It takes data from the past and moves it to the the present. This is the correct operation for the Ichimoku and probably any other delay operation that you're likely to do in Technical Analysis.
profile picture

SBondorowicz

#13
OK, I am obviously fundamentally misunderstanding the use of these operators. When I read the relavant section of the WealthScript programming guide I interpreted it as saying that the advance operator << shifted the data series n bars into the future and filled the first n bars with 0 whilst the delay operator >> shifted the data series n bars back.

Given that the delay operator is the correct one to use is it possible to view the span projected into the future as shown on most traditional Ichimoku charts, e.g. http://tradingichimoku.com/?
profile picture

Cone

#14
You can add a blank area to the right of the last bar by calling the PadBars(n) method, where n is the number of bars to move the chart to the left. Unfortunately, for the time being, you can only extend trendlines into that area. Plotting isn't currently possible there, so to see the entire cloud, you'd have to assign the p4 variable to 0.

Edit: Actually you'll need to remove the shift completely, or just assign p4 to 1. A zero shift is causing an error for some reason.
profile picture

SBondorowicz

#15
OK, thanks for the prompt reply. I need to spend some time thinking about what I am looking at on the Wealth-lab implementation. I confused the issue even more by adding the Chikou Span line which is lagged by 26 bars so I need to compare the charts with another source. If anyone is interested in Ichimoku a very good site is http://www.ichimokutrader.com/ which supplies free charts for stocks and indices from various exchanges.
profile picture

ptgap

#16
I get the following errors when trying to compile this script

error CS0116 @ (1.1) " A namespace cannot directly contain members such as fields or methods.
error CS1022 @ (20,1) : Type of namespace definition, or end of file expected

Any help greatly appreciated thanks.

Would also love to know how to activate the Chikou line within Wealth Lab.
Lastly, is there any way to color coordinate the cloud for bullish and bearish trends? Right now it seems you make the entire cloud only one color.

Thanks the the assistance.
profile picture

Eugene

#17
It's a portion of script, not the complete one, and therefore has to be treated accordingly. You can't just copy/paste it as is into a new Strategy window but have to do it properly. So as not to turn this very focused discussion into yet another C# 101 thread, here I'm going to give you only a quick advice and stop:

1. Note how the new Strategy template is organized. Now compare it with the scriptlet in post #9. You'll see that it contains just one part i.e. the Execute() method body. Copy (or overwrite) that in the proper place of the blank new strategy.

2. If you want to go further, please start by reading the manuals and FAQs:

Help menu > WealthScript Programming Guide > How to Run Example Code
FAQ > How do I get started learning Wealth-Lab?
FAQ > How do I start with C# ?
profile picture

ptgap

#18
Thanks very much, I managed to get the script working correctly, I then added the 9sma and 26sma lines, the only thing left is Chikou, will try to figure that out now. Thank you for the assistance.
profile picture

Eugene

#19
Here's a script that plots Chikou Span:

Chikou Span
profile picture

ptgap

#20
Excellent, chart looks fantastic in wealth lab right now. Thank you!

Last two questions:

1. How do I extend the chart in wealth lab 26 period forward so I can see the future projected cloud?
2. Where in wealth lab can I set up rules for Ichimoku so I can backtest different strategies and have trades generated (for example, the buy each time the cloud turns green, sell each time the cloud turns red) or to place buys and sells based on the Chikou line itself as it crossed areas of the cloud)

I am so close with this now, thanks again!

profile picture

Eugene

#21
1 - Give this a try: Ichimoku - Future Kumo

2 - Such rules don't exist yet you could download and install the Community Indicators library (don't forget to restart WLP) and then play with the Ichimoku indicators (SenkouSpanA, SenkouSpanB, TenkanSen and KijunSen) using conditions from the General Indicators group. This tutorial video should illustrate how to use indicators in rule-based Strategies: Designing Rule-based Strategies, Combining different Indicators.
profile picture

ptgap

#22
Thanks all looks good for the lines needed, and I see the future area now, although the last bar date I have is in September, but as long as the chart is accurate that shouldn't matter. I did download the extension pack earlier and applied the Ichimoku lines that were available, hopefully one day we will be able to backtest this strategy based on diff lines automatically like the other studies on the platform.

Thanks you again Eugene for getting this to where it for me.

Scott
profile picture

ptgap

#23
Is there a way to add the Chikou indicator in wealth lab pro? I am able to create a strategy from rules and apply the TenkanSen and KijunSen, but I am missing the Chikou. Thank you very much.
profile picture

Eugene

#24
The Chikou is a lagging line i.e. the most recent price plotted 26 bars into the past. You can not use it for systematic trading. Why do you need an indicator that peeks into the future?

At any rate, please review this conversation:

Chikou Span
profile picture

hplein

#25
Has the ability to plot future calculated values (The Cloud) and will this enable us to at least generate trades based in the rules that "look into the future"?
profile picture

Eugene

#26