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.

# 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 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 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 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 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 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,

Requesting Tams

##### 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);

## 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.

×   Pasted as rich text.   Paste as plain text instead

Only 75 emoji are allowed.

×   Your previous content has been restored.   Clear editor

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

×

• 6
• 0
• 1
• 3
• 7
• ### Posts

• the one that you study hard about
• Good Morning to all Gentlemen and Ladies. I've had a minor favor and is new to this forum at present. My request would be, could someone explained to me in a meek manner on how the calculation is dealt with? For instance, how do you calculate the TPO above/below the POC? Is it calculating by the means of the alphabets starting from "the POC or above" it?  Looking forward to hearing some response from anyone with a senior of experience in the application of Market Profile. Thank you in advanced!
• Near Term Outlook Unchanged as AUDUSD Trades Weaker   AUDUSD Price Analysis – August 22 The Aussie is holding weaker so far with the yuan softer on the day on a softer note for the equities and treasury yields. However, yuan has a relative effect on USD as the PBOC fixed the yuan weaker again today, reaffirming the notion that they will allow the currency to weaken but not too quickly.   Key Levels Resistance Levels: 0.7205, 0.7085, 0.6827 Support Levels: 0.6748, 0.6676, 0.6620   AUDUSD Long term Trend: Bearish But as seen in the daily picture above, the near-term picture in AUDUSD remains unchanged despite the pair slipping to session lows on the level at 0.6748 currently. Both buyers and sellers have more work to do to gain more momentum to push prices out of the downward range since last week.   While the forex pair is experiencing a stall, this could just be a correction, as both the medium and long-term trends are still bearish.   AUDUSD Short term Trend: Ranging However, AUDUSD needs to break the monthly support zone on the level at 0.6676, which is currently providing support for the momentum on the pair at the level at 0.6748.   The currency exchange rate will most likely continue to trade downward and flat for today waiting for the required volatility to change the direction.