How to create a new technical indicator with WLD 6.1
Author: lookingbackon
Creation Date: 3/5/2011 11:34 AM
profile picture

lookingbackon

#1
Hello,
I failed to find the function of "new indicator wizard"to create some new indicator for strategy development. Could you pls advice whether the function is still available with WLD 6.1 or not? Or any other solution to address the issue?
Thanks a lot for the support in advance.
Regards

Barry
profile picture

Eugene

#2
Hello Barry,

No, this feature is no longer available in WL6. Custom indicators that you drag and drop or use in the rule wizard ("formal" indicators) are developed in an IDE like Visual Studio or SharpDevelop and then used in WL6 as compiled libraries.

May I ask what kind of new indicator is on your mind? Could we help with coding it?
profile picture

lookingbackon

#3
Hello Eugene,
Thanks for the reply. Would be great if you help with coding some new indicators not available in the WLD6.1.

Basically, the idea is to create K,D and J indicators based on the Stoch%K, Stoch%D with 3 days. The calculation formula are as below:

Stoch%K=(Cn-Ln)/(Hn-Ln)*100

K = 3-day SMA of stoch%K
D = 3-day SMA of K
J = 3*K - 2*D

Would appreciate if you can help on the coding of those and find me a solution on how to add these indicators into "indicator" library of WLD6.1,so that I can drag/drop them to create specific strategy coding.
Regards
Barry
profile picture

Eugene

#4
Here's how you can code this oscillator on the fly:
CODE:
Please log in to see this code.

The resulting indicator doesn't fit in our criterias on including in Community Indicators (i.e. less than four math operations). Let me know if you need assistance on building your own library of compiled indicators that will include the K,D and J oscillators.
profile picture

lookingbackon

#5
Thanks a lot Eugene. It's really helpful.
Now I do need your assistance on how to add these indicators into my own library which can be used for drag/drop upon strategy develop/coding. ( This is actually my intention of my last post:))
Thanks
Barry
profile picture

Eugene

#6
The K and D indicators doesn't require including in an indicator library. Just drop a SMA over your StochK, and then drop another SMA on top of the first indicator.

Once you download the Community.Indicators source code from the Wiki (see your open ticket), get familiar with the IDE of choice, with the API manual (see "Create an Indicator Library"), here's the complete 'formal' indicator code to drop in your custom project. The StochK averaging period, the two coefficients etc. -- all variables are made configurable.
CODE:
Please log in to see this code.
profile picture

lookingbackon

#7
Thanks, got it.
Another question for your help:

within a strategy coding,is it possible to use weekly KDJ data for long term trend judgment then use daily KDJ data for entry/exit trigger? I mean whether it is allowable to quote weekly and daily data in one strategy?
e.g.: the idea is that(for instance):
(1)If Weekly J > weekly K
(2)And Daily J up cross over Daily K
Then Enter Long at market price
Thanks
profile picture

Eugene

#8
QUOTE:
I mean whether it is allowable to quote weekly and daily data in one strategy?

Sure it's possible. Check out the WealthScript Programming Guide (section "Multi-Time Frame Analysis") and the QuickRef, "Time Frames".
CODE:
Please log in to see this code.
profile picture

lookingbackon

#9
It's really great. Thanks a lot Eugene.
Look forward to receive further support/help from you.
Regards
Barry
profile picture

lookingbackon

#10
Hello Eugene,

I got difficultes to transfer the follwoing entry and exit idea into correct strategy coding:

Entry rules
(1)If Weekly J > weekly K
(2)and If Daily D < paramOversold (Oversold,50,1,100,1)
(3)and If Daily J up CrossOver Daily K
Then buy at market price

Exit Rules
(1)If Weekly J down CrossOver Weekly K
Then sell at market price

Could you pls help on that? Thanks
Barry
profile picture

Eugene

#11
What exact difficulties have you got?
profile picture

lookingbackon

#12
I formulated the following draft trading system, but looks like can't properly run accordingly to the criterion. Could you pls help to check whether there is something wrong with syntax or others?
CODE:
Please log in to see this code.

Below is the whole draft strategy coding for reference.
CODE:
Please log in to see this code.
profile picture

Eugene

#13
When posting code please use the CODE tag. It's very easy, just click on CODE and paste it in between the tags.
1. Incorrect syntax:
CODE:
Please log in to see this code.

Should be:
CODE:
Please log in to see this code.

For more details refer to the WealthScript Programming Guide, Programming Trading Strategies > Strategy Parameters.
2. Next:
CODE:
Please log in to see this code.

Should be:
CODE:
Please log in to see this code.

3. Last but not least:
CODE:
Please log in to see this code.

Should be:
CODE:
Please log in to see this code.

Otherwise the system will never take a trade.
profile picture

lookingbackon

#14
Thanks a lot. Now it's working.