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

    • Agreed. What makes them interesting or not is their jurisdiction and the regulatory authority. Those NEED to be good ans serious. Everything else is secondary.
    • Date : 17th September 2020.The Guppy dips to 135.00, having stalled at 136.00.GBPJPY, Daily Both the UK and Japan are in the middle of political upheavals, (the Brexit Trade talks and Internal Market Bill on one side and the handover from one political dynasty to his trusted lieutenant on the other. Earlier today we had the BOJ signalling No Change to current policy as the new PM Suga completes his first few days in the role. The BOE has just published their statement¹ and minutes from their latest meeting, and again it’s no change across the board, (excuse the pun), although the spectre of negative interest rates in the UK is more firmly “in the toolbox” than ever before. The BOE continues to negotiate the tricky ground around monetary policy with the backdrop of deteriorating UK-EU relations and the likelihood of PM Johnson overseeing a very limited trade deal with the EU, if one is agreed at all. The Brexit endgame showdown is very much “in-play”.BOE highlights include – “stands ready to adjust monetary policy”, and to“keep under review the range of actions” – taken as a nod to possible negative rates next year with the statement that the MPC has been briefed on the BoE’s plans to explore how a negative bank rate could be implemented effectively. It also “does not intend to tighten monetary policy until there is clear evidence that significant progress is being made in eliminating spare capacity and achieving the 2% inflation target sustainably.”Cable continues to rotate around 1.2900 today, whilst EURGBP jumped from 0.9090 to 0.9150 and GBPJPY plunged to 135.00 a level not seen since July 20, some 42 trading days ago.Always trade with strict risk management. Your capital is the single most important aspect of your trading business.Please note that times displayed based on local time zone and are from time of writing this report.Click HERE to access the full HotForex Economic calendar.Want to learn to trade and analyse the markets? Join our webinars and get analysis and trading ideas combined with better understanding on how markets work. Click HERE to register for FREE!Click HERE to READ more Market news. Stuart Cowell Head Market Analyst HotForex Disclaimer: This material is provided as a general marketing communication for information purposes only and does not constitute an independent investment research. Nothing in this communication contains, or should be considered as containing, an investment advice or an investment recommendation or a solicitation for the purpose of buying or selling of any financial instrument. All information provided is gathered from reputable sources and any information containing an indication of past performance is not a guarantee or reliable indicator of future performance. Users acknowledge that any investment in FX and CFDs products is characterized by a certain degree of uncertainty and that any investment of this nature involves a high level of risk for which the users are solely responsible and liable. We assume no liability for any loss arising from any investment made based on the information provided in this communication. This communication must not be reproduced or further distributed without our prior written permission.
    • a (probably temporary) bout of sanity https://www.zerohedge.com/political/premier-league-soccer-abandons-blm-political-movement     ie  blm  Yes BLM No
    • https://drmalcolmkendrick.org/2020/09/04/covid-why-terminology-really-matters/
    • "I use the word derealization to describe the inner disconnect between what we experience and what the propaganda / marketing complex we live in tells us we should be experiencing. Put another way: our lived experience is derealized (dismissed as not real) by official spin and propaganda." http://charleshughsmith.blogspot.com/2020/09/the-four-ds-that-define-future.html
×
×
  • Create New...

Important Information

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