Need help again, because I simply do not understand the logic behind that language.
Inthe following efs it is mentioned that:
"you can create a nearly Gaussian probability density function by normalizing price
(or an indicator such as RSI) and applying the Fisher Transform."
So if I want to do that for example with the RSI, how would I need to modify the following original Fisher.efs?
Alexis, I know you will help me out, like so many other times.
Think, it's about time for a bottle of champagne.............
thank you
Inthe following efs it is mentioned that:
"you can create a nearly Gaussian probability density function by normalizing price
(or an indicator such as RSI) and applying the Fisher Transform."
So if I want to do that for example with the RSI, how would I need to modify the following original Fisher.efs?
PHP Code:
addBand(1.5, PS_SOLID, 2, Color.red, "1.5");
addBand(1.38, PS_DASH, 1, Color.white, "1.38");
addBand(1.25, PS_DASH, 1, Color.white, "1.25");
addBand(1, PS_DASH, 1, Color.black, "1");
addBand(.75, PS_DASH, 1, Color.yellow, ".75");
addBand(.5, PS_DASH, 1, Color.white, ".5");
addBand(0, PS_SOLID, 2, Color.green, "0");
addBand(-.5, PS_DASH, 1, Color.white, "-.5");
addBand(-.75, PS_DASH, 1, Color.yellow, "-.75");
addBand(-1, PS_DASH, 1, Color.black, "-1");
addBand(-1.25, PS_DASH, 1, Color.white, "-1.25");
addBand(-1.38, PS_DASH, 1, Color.white, "-1.38");
addBand(-1.5, PS_SOLID, 2, Color.red, "-1.5");
function preMain(){
setStudyTitle("Ehlers");
setCursorLabelName("Fisher", 0);
setCursorLabelName("Trigger", 1);
setDefaultBarFgColor(Color.red, 0);
setDefaultBarFgColor(Color.black, 1);
var fp01 = new FunctionParameter("Len", FunctionParameter.NUMBER);
fp01.setName("Length");
fp01.setLowerLimit(5);
fp01.setDefault(9);
}
var Fish = 0;
var Fish_1 = 0;
var Value1 = 0;
var Value1_1 = 0;
function main(Len) {
if (Len == null)
Len = 9;
if(getBarState() == BARSTATE_NEWBAR) {
Fish_1 = Fish;
Value1_1 = Value1;
}
var Price = (high() + low()) / 2;
var Pricei= (high() + low()) / 2;//added this variable
var MaxH = 0;
var MinL = 0;
var i;
setBarThickness(2,0);
setBarThickness(2,1);
for(i = 0; i < Len; i++) {
Pricei = (high(-i) + low(-i)) / 2; //added this line
if(i == 0){
MaxH = Pricei;//changed from: MaxH = high()
MinL = Pricei;//changed from: MaxH = low()
}
else{
MaxH = Math.max(MaxH, Pricei);//changed from: MaxH = Math.max(MaxH, high(-i))
MinL = Math.min(MinL, Pricei);//changed from: MinL = Math.min(MinL, low(-i))
}
}
var num1 = (MaxH - MinL);
if (num1 <.001)
num1 = .001;
Value1 = .33 * 2 * ((Price - MinL) / (num1) - .5) + .67 * Value1_1;
if(Value1 > .99)
Value1 = .999;
if(Value1 < -.99)
Value1 = -.999;
var num2 = (1 - Value1);
if (num2 <.001)
num2 = .001;
Fish = .5 * Math.log((1 + Value1) / num2) + .5 * Fish_1;
return new Array(Fish,Fish_1);//removed the redundant temp variable, use Fish_1 instead
}
Alexis, I know you will help me out, like so many other times.
Think, it's about time for a bottle of champagne.............
thank you
Comment