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.


  • Topics

  • 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.    
    • Staying Within Previous Boundary EURJPY Continues to Trade Within a Range   %2> EURJPY Price Analysis – August 23 In today’s trading session, the common European currency traded sideways against the Japanese Yen. The currency pair was trading below the moving average 5 and 13 since yesterday’s trading session. We may see bearish traders pressurize the currency pair towards the level at 117.50 before the end of today’s trading session.     Key Levels  Resistance Levels: 123.01, 119.88, 118.33  Support Levels: 117.65, 117.50, 117.00    EURJPY Long term Trend: Bearish In the daily picture, the EURJPY pair may most likely maintain the price range during the next trading session. Alternatively, a breakout may occur downwards.  While the exchange rate has been trading within the range of the level at 118.33 and 117.50 since mid-August. The trend is bearish, showing an intact downtrend in the medium and long-term.     EURJPY Short term Trend: Bearish Today’s trading range has been going negative and more, and that’s below the last trading month’s daily average range. On the flip side, we may see a change in trend with renewed upward strength.   Buying could accelerate should prices move above the close-by swing high towards the level at 118.33 where further buy stops might get activated. Although with the level at 119.88 resistance intact, near term outlook remains bearish.  
×
×
  • Create New...

Important Information

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