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
• 80
• 0
• 0
• 1
• ### Posts

• Why are Market Wizard's insults and humiliations tolerated with impunity whereas our replies are sistematically banned? Just curious.
• Bitcoin (BTC) Consolidates As Bears And Bulls Tussle Above \$9,400 Support Key Resistance Zones: \$10,000, \$11,000, \$12,000 Key Support Zones: \$7, 000, \$6, 000, \$5,000 BTC/USD Long-term Trend: Ranging Bitcoin has failed to break above \$10,400 overhead resistance. The bulls made two unsuccessful attempts at the resistance. In the recent one, the bears took the price to a low of \$9,290 and then pulled back above \$9,400. In the interim, the price is fluctuating above \$9,400 and approaching the high of \$9,800. As the bulls have failed to push above the overhead resistance, the pair may commence a range movement. Nonetheless, it is anticipated that if the bears break below the \$9,400 support, selling pressure may resume. Meanwhile, BTC may continue the range-bound movement. BTC/USD – Daily Chart Daily Chart Indicators Reading: After the downward move of Bitcoin, the Relative Strength Index has also fallen to level 52. This simply means the coin is above the centerline 50. In other words, BTC is in an uptrend and it is likely to rise. Price broke the support line of the ascending channel. The uptrend will be in proper perspective only when the bulls break into the ascending channel. BTC/USD Medium-term Trend: Bearish On the 4- hour chart, Bitcoin now trades between \$9,400 and \$10,200 after the first breakdown at the \$10,400 overhead resistance. The bulls tested the resistance at \$10,200 twice , before the downward move. The large bearish candlesticks tested a low of \$9,290. However, the small body candlesticks that follow are called indecisive candlesticks. BTC/USD – 4 Hour Chart 4-hour Chart Indicators Reading Presently, BTC is trading above a 25% range of the daily stochastic. That is the coin is in the bullish trend zone. The 21-day SMA and the 50-day SMA are sloping horizontally indicating a sideways trend. General Outlook for Bitcoin (BTC) From every indication, if the bulls fail to push above the overhead resistance, the price action in October and November will repeat itself. For the past three days, BTC is still fluctuating above \$9,400. Instrument: BTC/USD Order: Sell Entry price: \$9,700 Stop: \$9,900 Target: \$8,400 Note: Learn2Trade.com is not a financial advisor. Do your research before investing your funds in any financial asset or presented product or event. We are not responsible for your investing results Source: https://learn2.trade
• The Sharp Recovery In EURJPY Lose Momentum, Falters Beneath The Level At 121.00 EURJPY Price Analysis – February  21 The single European currency rose 88 basis points or 0.73% against the Japanese yen in the previous session. After two consecutive sessions showing strong growth, EURJPY is now losing some momentum amid JPY bulls. Key Levels Resistance Levels: 122.37, 122.87, 121.00 Support Levels: 119.99, 117.08, 115.83 EURJPY Long term Trend: Ranging The EURJPY rebound from the level of 118.46 continues to advance from the previous session, but today it has stalled. Super-speed acceleration claims that a decline from 122.87 level could have ended in three waves to 118.46 level. However, the support level formed by the intersection of the moving average of 5 and 13 at 119.90 level can support the exchange rate during the trading session on Friday, while greater advance can continue from the level of 115.83. EURJPY Short term Trend: Ranging From an analysis of the 4-hour time frame, the intraday bias is now on the rise for a resistance level of 121.15 at first. The breakthrough will be aimed at 122.87 high levels. On the other hand, a breakdown of the secondary support levels of 119.99 could change the bias towards lower testing to retest the low level of 118.46 instead. Instrument: EURJPY Order: Sell Entry price: 121.00 Stop: 119.66 Target: 121.47 Note: Learn2Trade.com is not a financial advisor. Do your research before investing your funds in any financial asset or presented product or event. We are not responsible for your investing results Source: https://learn2.trade
• What makes InstaForex a good choice is that it is a reliable binary options trading platform so the trader would not have to dread anything if he decides to choose this platform.  They offer a 24/7 consultancy support. The exclusive online support facilitates the trader to get all the help that he has been looking for so far. This means that if the trader has any questions he can put them up ready to reach a solution to his problems. InstaForex provides trading binary options on currency pairs, cryptocurrency pairs, metals, and CFDs on shares.   InstaForex Broker 2.000\$ Forex / Binary Options No Deposit Bonus! Crypto Trading Available! https://binaryoptionsfree.eu/review/instaforex-broker-2-000-forex-binary-options-no-deposit-bonus/
• CRYPTOBO Broker - Binary Options No Deposit Cryptocurrency Bonus Real 10,000 Satoshi For Free!Make Financial Bets using Bincoins and win Bitcoins!Receive 10,000 Satoshi for Free Without Deposit to bet and win!Read CRYPTOBO Review!
×
×
• Create New...