I have the code in Easy Language and Thinkscript, but have not yet converted it to Ninjascript. Before I go through the process of attempting to convert it though, I'd like to know if it's even possible to calculate the RSI value of a smoothed price average of the bar close instead of the RSI value of just the close and then use that calculated value as part of an equation, the result of the equation being that which is plotted. I'm pretty sure it's possible to do this, but I just want to make sure, before I start converting and end up hanging myself out of frustration because it ends up being not possible.
This is a simplified version, in easy language, of what I'm using.
Parts of the code that I'm wondering about are in bold.
inputs: RSILength(1);
inputs: EMALength(1);
vars: SIF(0);
value3 = WAverage (close, 3);
value4 = WAverage (value3, 3);
value5 = XAverage (value4, 3);
value 6 = (5 * value3+4 * value4 + value5) / 20;
value7 = .1*(RSI(value 6, RSILength) - 50);
value8 = XAverage (value7, EMALength);
value9 = XAverage (value8, EMALength);
value10 = (value8 - value9);
value11 = (value8 + value10);
SIF = (ExpValue(2*value11) -1) / (ExpValue(2*value11) + 1);
Plot1(SIF, "SIF");
One other question I have is, are there already built in functions for things like XAverage (exponentially weighted moving average) or will I need to build a function myself?
I know that ninjascript is based on C# so should I assume all functions from C# are present in ninjascript, or is there a manual I should look for elsewhere?
Comment