Jump to content

Welcome to the new Traders Laboratory! Please bear with us as we finish the migration over the next few days. If you find any issues, want to leave feedback, get in touch with us, or offer suggestions please post to the Support forum here.

  • Welcome Guests

    Welcome. You are currently viewing the forum as a guest which does not give you access to all the great features at Traders Laboratory such as interacting with members, access to all forums, downloading attachments, and eligibility to win free giveaways. Registration is fast, simple and absolutely free. Create a FREE Traders Laboratory account here.

wchg

Easy Language Function Needed

Recommended Posts

Hi I'm trying to do some translation between thinkscript and easylanguage. Does

anyone know the equivalent of CompoundValue in easylanguage?

 

CompoundValue function in TOS_thinkscript:

 

Syntax:

 

compoundValue(int length, IDataHolder visible data, IDataHolder historical data);

 

Description:

 

Calculates a compound value according to following rule: if a bar number is bigger than length then the visible data value is returned, otherwise the historical data value is returned. This function is used to initialize studies with recursion.

 

Thanks a lot!

Share this post


Link to post
Share on other sites
Hi I'm trying to do some translation between thinkscript and easylanguage. Does

anyone know the equivalent of CompoundValue in easylanguage?

 

CompoundValue function in TOS_thinkscript:

 

Syntax:

 

compoundValue(int length, IDataHolder visible data, IDataHolder historical data);

 

Description:

 

Calculates a compound value according to following rule: if a bar number is bigger than length then the visible data value is returned, otherwise the historical data value is returned. This function is used to initialize studies with recursion.

 

Thanks a lot!

 

do you have the TOS code?

Share this post


Link to post
Share on other sites

Hi, Tams

 

This is a TOS Code:

 

declare lower;

 

input alpha = 0.02;

input price = close;

 

input pthree =0.0005 ;

input nthree = -0.0005;

 

 

def smooth = (price + 2 * price[1] + 2 * price[2] + price[3]) / 6;

rec cycle = compoundValue(6, Sqr(1 - 0.5 * alpha) * (smooth - 2 * smooth[1] + smooth[2]) + 2 * (1 - alpha) * cycle[1] - Sqr(1 - alpha) * cycle[2], (price - 2 * price[1] + price[2]) / 4);

 

plot CCO = cycle;

plot ZeroLine = 0;

plot plus1 = pthree;

plot minus1 = nthree

Share this post


Link to post
Share on other sites

you need the code for "compoundValue".

 

 

ps. please use the code tag to wrap the code. It is the # key at the top of the message window.

 

tagged code looks like this:

 

declare lower;

input alpha = 0.02;
input price = close;

Share this post


Link to post
Share on other sites

The code is:

 

#

declare lower;

 

input alpha = 0.02;

input price = close;

 

input pthree =0.0005 ;

input nthree = -0.0005;

 

 

def smooth = (price + 2 * price[1] + 2 * price[2] + price[3]) / 6;

rec cycle = compoundValue(6, Sqr(1 - 0.5 * alpha) * (smooth - 2 * smooth[1] + smooth[2]) + 2 * (1 - alpha) * cycle[1] - Sqr(1 - alpha) * cycle[2], (price - 2 * price[1] + price[2]) / 4);

 

plot CCO = cycle;

plot ZeroLine = 0;

plot plus1 = pthree;

plot minus1 = nthree;

#

Share this post


Link to post
Share on other sites

Hi Wchg,

 

If you see the code that you have posted...

 

compoundValue(6, Sqr(1 - 0.5 * alpha) * (smooth - 2 * smooth[1] + smooth[2]) + 2 * (1 - alpha) * cycle[1] - Sqr(1 - alpha) * cycle[2], (price - 2 * price[1] + price[2]) / 4);

 

where compoundValue is a function which carries 3 parameters.

 

#Param1 = 6,

 

#Param2 = Sqr(1 - 0.5 * alpha) * (smooth - 2 * smooth[1] + smooth[2]) + 2 * (1 - alpha) * cycle[1] - Sqr(1 - alpha) * cycle[2],

 

#Param3 = (price - 2 * price[1] + price[2]) / 4.

 

So try if you can post the code for CompoundValue function.

 

Am I correct Tams?

 

Thanks,

Easytrader_I

Edited by EasyTrader_I
Requesting Tams

Share this post


Link to post
Share on other sites

did you find out the code for compoundvalue?

im also looking for the answer on the question you have posted ..

Hi I'm trying to do some translation between thinkscript and easylanguage. Does anyone know the equivalent of CompoundValue in easylanguage?

CompoundValue function in TOS_thinkscript:

compoundValue(int length, IDataHolder visible data, IDataHolder historical data);

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.