ITrend (Ehlers Instantaneous Trendline) translation
Author: Carova
Creation Date: 1/25/2015 11:14 AM
profile picture

Carova

#1
I am trying to convert my first indicator for the WL4 Code Library and, as might be expected, I am having a problem. Could someone please explain to me what I am doing wrong? Thanks!

Vince

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

Eugene

#2
Ehlers InstantaneousTrendLine is member of TASCIndicators.
profile picture

Carova

#3
This is a different version from the one in the TASCIndicators. I do believe that he has published at least 6 different versions of this indicator, and they vary dramatically.

Vince
profile picture

Eugene

#4
You are mixing WSTL-generated code (driven by WSTL internally) with pure WealthScript. This is not going to work. We warned about that numerous times on this forum.

Solution:

1. Drop your later addition:

CODE:
Please log in to see this code.


2. Code it in old-fasioned way (WL4) and let WSTL do the translation of the whole script. It'll end up with something like this (non-functioning example):

CODE:
Please log in to see this code.


Please don't ask me about the proper syntax. We no longer support WL4 or WSTL.
profile picture

Carova

#5
QUOTE:
Code it in old-fasioned way (WL4) and let WSTL do the translation of the whole script. It'll end up with something like this (non-functioning example):

CODE:
Please log in to see this code.

OK, I will do that.

QUOTE:
You are mixing WSTL-generated code (driven by WSTL internally) with pure WealthScript. This is not going to work. We warned about that numerous times on this forum.
I have read a bunch on this portion of the Forum but have missed this point. Does that mean I will need to modify my WL4 scripts rather than edit the C# code directly? Or does it make more sense to attempt to hand translate the code into C# directly and then learn to embed the code modules into the WLP scripts that I will attempt to write? Some guidance is needed here. Thanks!

Vince
profile picture

Eugene

#6
QUOTE:
Or does it make more sense to attempt to hand translate the code into C# directly and then learn to embed the code modules into the WLP scripts that I will attempt to write?

Yes.
profile picture

Carova

#7
Hi All!

Here is my first feeble attempt to convert a WL4 indicator to WLP6.

The WL4 code:
CODE:
Please log in to see this code.


The (almost?) working WLP6 code:
CODE:
Please log in to see this code.


Unfortunately I am getting an error - "error CS0103 @ (125,25): The name "bar' does not exist in the current context"

1) What am I doing wrong?
2) Have I translated it properly?

Thanks!
Vince
profile picture

Eugene

#8
It's more like this (on-the-fly edit; I haven't verified it). PartialValue can be omitted, it's optional:
CODE:
Please log in to see this code.
profile picture

Carova

#9
Thanks Eugene!

When you get a chance could you please see if I coded it correctly? I am in the process of getting my C# "legs" working.

Also, how can I submit this to Community Indicators?

Vince
profile picture

Eugene

#10
QUOTE:
Also, how can I submit this to Community Indicators?

You have already done so. Thank you for your submission Vince. I'll inspect the code and it will appear in next release of the library if everything is OK.
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).