Instateneous Trendline (from TOS script)

 

Hi,

I'm new to MT4, and still learning to adapt with its utility....Hope through this forum can get help help to translate this script (from Thinkorswim platform) to MT4....

Tx in advance...


Rgds,

Gugun


#---Star---t#


declare upper;

rec price = ((high + low) / 2);
input alpha = 0.07;

rec itrend = compoundValue(7, ((alpha - alpha * alpha / 4) * price + 0.5 * alpha * alpha * price[1] - (alpha - 0.75 * alpha * alpha) * price[2] + 2 * (1 - alpha) * itrend[1] - (1 - alpha) * (1 - alpha) * itrend[2]), ((price + 2 * price[1] + price[2]) / 4));

rec trigger = 2 * itrend - itrend[2];

plot inst_trend = itrend;
plot trig = trigger;

#----End-----#

 

Does that thing even compile in mql4? Attach the complete source or paste the complete code.

 
  1. Of course it doesn't. The OP said it's a Thinkorswim platform script.
  2. Mql4 doesn't have a compoundValue function. You'll have to find out what that does and code it
  3. No Slaves here, learn to code or pay someone.
  4. Or you could have used this which took me 30 seconds to find this
Reason: