From Metastock to Wealth-Lab: "Moving Stop Loss"
Author: novaege
Creation Date: 3/4/2011 3:24 PM
profile picture

novaege

#1
Hi,

Is there a reference document to translate codes from metastock to wealthlab.
Cross(), Ref(), Max(), Min() , ... matches which functions in wealtlab.

Wealthlab guide wealthscript is not enough to code. Is there any helpful resources?

profile picture

Eugene

#2
Cross ?= CrossOver/CrossUnder (see the QuickRef)
Max, Min - standard .NET functions Math.Max, Math.Min
profile picture

novaege

#3
Thanks for reply,

i am looking for MAX(data array, data array) function.
I will try to implement using DataSeries.maxValue comparision
profile picture

Eugene

#4
What does MAX(array, array) do? You should not use DataSeries.MaxValue (or MinValue) in main loop -- it's a peeking function which is instantly aware of the highest value that (may) happen in the future.

In WealthScript we use different patterns. Let's start with what exact task do you want to solve?
profile picture

novaege

#5
I have metastock code below,

CODE:
Please log in to see this code.


I am trying to convert this.
profile picture

Eugene

#6
Very good. Could you describe the rules in English please? (If I'm not mistaken this is some trailing stop.) I just wouldn't like to end in translating something that we already have or something close just because we weren't told the name of the indicator/system.
profile picture

novaege

#7
Indicator's name is Moving Stoploss in Metastock.

Couldn't i use BarSince in WealthLab Developer when implementing custom indicator?
Must i buy Community Components?
Is there any complete/better document/book/website for developers?
profile picture

Eugene

#8
QUOTE:
Is there any complete/better document/book/website for developers?

What you need to know about WealthScript to build code-based strategies, can be found in the QuickRef, WealthScript Programming Guide, and in the Wiki/the forums.

If you're starting out, a few pointers could be found in this FAQ: How do I start with C# ?
QUOTE:
Must i buy Community Components?

As noticed in the support ticket, Wealth-Lab extensions are free.
QUOTE:
Couldn't i use BarSince in WealthLab Developer when implementing custom indicator?

Yes you can, either via the BarsSince fuction of Community.Components or by coding it from scratch.
profile picture

Eugene

#9
Here's your moving stop loss:
CODE:
Please log in to see this code.

Requires Community.Components. You might want to search for the BarsSince code on the forums as a drop-in replacement, or code this pretty simple function yourself.
profile picture

novaege

#10
Thanks for reply.
I will look purchasing options to get and use Community.Components .
profile picture

powerade

#11
Is that mean only people who bought wealthlab can use community components and any other extensions listed on get extensions page?
profile picture

Eugene

#12
Why have you registered another user name and keep asking the same question over and over here and in the support portal? Give us some credit please.
profile picture

novaege

#13
Because i am not sure to buy? I am trying to compare it with metatrader?

There is a paragraph in wealthscript guide is making me confused
QUOTE:
Functions that exist in the {}WealthLab namespace but that are not
documented in the QuickRef have no guarantee or warranty for use in
Strategy code.


And also i am trying to learn what functionalities wealthlab contains such a restricted trial environment?
And i have metastock codes. I am also looking for functions in wealthlab to answer how can i transfer them.
profile picture

Eugene

#14
QUOTE:
There is a paragraph in wealthscript guide is making me confused

It talks about nothing that a new user should really be worried about. The WealthScript namespace contains many internal classes and methods required for various purposes, and our policy is: whatever method/function/class is not documented the QuickRef/Programming Guide/Wiki, is not officiallly supported. Motivated programmers can use them for what they find useful, but they are not required.
QUOTE:
And also i am trying to learn what functionalities wealthlab contains such a restricted trial environment?

As the User Guide notes, Wealth-Lab Version 6 comes with a free 30-day trial period that you can use in an unlimited evaluation of the software. There's no limitation in Wealth-Lab functionality. Our position regarding Extensions (which are not a part of the software) and their source code is explained in the Wiki FAQ.
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).