lewiston, minnesota, usa
Experience: None
Platform: nt,ts
Trading: es
Posts: 3 since Oct 2010
Thanks Given: 0
Thanks Received: 0
|
I have a third party indicator that I use on the TOS platform.
I would like to have the indicator written for NinjaTrader 8.
I copied the code source from the TOS platform.
It is a follows:
# The Itrend indicator from John Ehler's book "Cybernetic Analysis for Stocks and Futures"
input price = hl2;
input alpha = 0.07;
rec itd = compoundValue(7,(alpha - alpha*alpha/4) * price + 0.5*alpha*alpha*price[1] - (alpha - 0.75*alpha*alpha) * price[2] + 2 * (1-alpha)*itd[1] - (1-alpha)*(1-alpha)*itd[2], (price+2*price[1] + price[2])/4);
def trg = 2*itd-itd[2];
plot Itrend = itd;
plot Trigger = trg;
Itrend.DefineColor("Up", Color.Blue);
Itrend.DefineColor("Down", Color.Red);
Itrend.AssignValueColor(if Itrend[0] > Itrend[1] then Itrend.color("Up") else Itrend.color("Down"));
I would like someone to convert this code from TOS to NT 8.
Any suggestions?
Thanks,
Leon
|