Own Trending ChartStyle: how to get signals
Author: dansmo
Creation Date: 5/5/2010 7:26 AM
profile picture

dansmo

#1
Hi,

I have created my own ChartStyle. Now I´d like to access its information to create signals upon it. How can I do that? For example I would like to buy if there were three upward bricks in a row.

dansmo
profile picture

Eugene

#2
Hi,

"Backtesting with ChartStyles.Trending" in the WealthScript Programming Guide might be helpful.
profile picture

dansmo

#3
Yes, but how do I fill Column for my own ChartStyle?
profile picture

Eugene

#4
Have you already taken a look at the prepackaged Strategy "Kagi Basic"?
profile picture

dansmo

#5
I had a look at this:

CODE:
Please log in to see this code.


Having my own ChartStyle called ExperimentalChartStyle.
However replacing "Renko" with "Experimental" wont do it because there is
no defintion for Columns in my namespace. I dont get it.
profile picture

Cone

#6
You can only access public methods and properties that your ChartStyle makes available. How can we can tell you how to use something that you've programmed?
profile picture

dansmo

#7
Of course not. I thought there would be something that describes hot to create columns for a own ChartStyle.
Something like SetBarWidth --> SetColumns.
profile picture

dansmo

#8
Okay, I think I understand it now. I "just" need to create a Column class for each traditional bar in the chart. I then can access this class for every bar in WLD and use this information.
profile picture

Cone

#9
You don't have to do it that way, but that was my solution.

Note that you have to actually be using a Renko Chart to access its methods by casting the RenkoChartStyle. This isn't necessarily desirable since there is no Chart object in tools like Rankings or Strategy Monitor. Unfortunately, I didn't catch on to that until after I finished writing Renko, Kagi, and LineBreak. But that's why PnF took a more-versatile approach. It uses a separate TPnF class that calculates and stores the PnF Column data that the Chart Style uses. You can, then, access the same class in your script that the Chart Style uses without needing to cast the ChartStyle.
profile picture

dansmo

#10
In the meantime I thought about how to solve this:

I store all necessary value in Dictionaries for ever traditional OHLC bar. Now I provide some get-methods that provide these Dictionaries directly to WLD. This way it is possible to use all values etc. I later use for rendering the chart.

First examples show that this will do it for me.
profile picture

dansmo

#11
@Cone
I need a hint with this.
I wanted to modify my code, so that it matches your solution. All the necessary calculations should be in a own calculator class. However, I dont get it done:

This class does all the chartStyle things for WLD and has Initialize, SetBarWidth etc:
CODE:
Please log in to see this code.


Now, I wanted to add a class
CODE:
Please log in to see this code.

to do all the calculation. However, I get lots of errors.
When adding FlexRenko: ChartStyle it is telling me that I need Initialize() etc. How do I have to set up this class?? Just like you did it with TPnF class!
profile picture

Cone

#12
I can't troubleshoot your errors, but FlexRenko should be a completely separate, but public class that you instantiate in FlexibleRenkoChartStyle.
profile picture

dansmo

#13
QUOTE:
I can't troubleshoot your errors

That´s not what I posted for.
Since you wrote the TPnF class I thought you could give me some insights.
Why does FlexRenko need to inherit the methods InitializeBarWidths(), Glyph(). I mean: I have these in the FlexibleRenkoChartStyle class. How can I avoid thos?
profile picture

Cone

#14
QUOTE:
Why does FlexRenko need to inherit the methods InitializeBarWidths(), Glyph().
It shouldn't; it's not a ChartStyle.
profile picture

dansmo

#15
I must be missing something important here, but I dont have a clue what it is and how to fix it:

this is the start of the class:
CODE:
Please log in to see this code.


Now, it says I need a object reference for "WealthLab.Bars.High.get".
profile picture

Cone

#16
Maybe you should pass the reference of the Bars object (the basis for your brick data) to calculateRenkos.

Those are a lot of dictionaries when you only need one... <Int32, Renko>, where Renko is a class that has the brick data. In other words, summarize the data in one Renko object for each bar.
profile picture

dansmo

#17
Okay, I think I have understood. Thank you.

One more issue:
CODE:
Please log in to see this code.

This line throws a System.FormatException. I cannot figure what went wrong here. Is there any way to clear these settings? Do you have any idea what could be wrong?
profile picture

Eugene

#18
QUOTE:
Is there any way to clear these settings?

It's in the WealthLabConfig.txt file, look inside the Data directory (see the User Guide > Data, the path isn't trivial and is not under Program Files).
profile picture

dansmo

#19
Thank you. There was a decimal separator problem. In the Config there was a comma saved.
profile picture

dansmo

#20
Hi Cone,

need a hint with your suggestion in your post:
QUOTE:
Those are a lot of dictionaries when you only need one... <Int32, Renko>, where Renko is a class that has the brick data. In other words, summarize the data in one Renko object for each bar.


I try it this way:

CODE:
Please log in to see this code.


and then:

CODE:
Please log in to see this code.


However, it wont let me have access to Renk() due to security reasons. Can you give me a hint what I am doing wrong here?
profile picture

Cone

#21
Not enough information.
profile picture

dansmo

#22
May I contact you via Support ticket with the full code?
profile picture

Cone

#23
I hate to see anyone struggle with solutions (we all do from time to time) but per Our Support Policy, custom solutions are very low priority for me - I'm overloaded, really.

dansmo, pardon the suggestion, but I think you can get a lot of mileage at a site like Experts Exchange. For only about $100/yr, you can get programmers around the world working on problems for you, often the same day. Check it out.
profile picture

Eugene

#24
QUOTE:
However, it wont let me have access to Renk() due to security reasons.

What is the exact error message in the compiler?
profile picture

dansmo

#25
QUOTE:
Fehler 1 Der Zugriff auf "Dansmo.ChartStyles.FlexRenko.Renko.Renko()" ist aufgrund der Sicherheitsebene nicht möglich.
profile picture

Eugene

#26
This is the infamous Compiler Error CS0122 i.e. Renko.Renko is inaccessible due to its protection level. In other words, even though your code dated 7/7/2010 doesn't show it on the first look, the Renko class somewhere is missing the "public" modifier and in fact is private.
profile picture

dansmo

#27
Yes, that is how I understand it, too. But I cannot figure out why. All classes are "public class". I dont know how to fix it.
profile picture

Eugene

#28
Attach your project to a new ticket please, I'll try to take a look at this specific error.
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).