Hi-
I'm having trouble getting this Fisher xform indicator to update accurately on my tick charts (any charts). Any ideas would be helpful.
Thanks
D.
I'm having trouble getting this Fisher xform indicator to update accurately on my tick charts (any charts). Any ideas would be helpful.
Thanks
D.
PHP Code:
function preMain()
{
setStudyTitle("Fisher XForm");
setCursorLabelName("Fisher", 0);
setCursorLabelName("Trigger", 1);
addBand(0, PS_SOLID, 1, Color.aqua);
setDefaultBarFgColor(Color.green, 0);
setDefaultBarFgColor(Color.red, 1);
setDefaultBarThickness(1,0);
setDefaultBarThickness(1,1);
}
var Value1_1 = 0;
var Fish_1 = 0
function main(Len) {
if (Len == null)
Len = 15;
var Price = (high() + low()) / 2;
var MaxH = 0;
var MinL = 0;
var Fish = 0;
var i;
var Value1 = 0;
var temp;
for(i = 0; i < Len; i++)
if(i == 0){
MaxH = high();
MinL = low()
}else{
MaxH = Math.max(MaxH, high(-i));
MinL = Math.min(MinL, low(-i));
}
Value1 = .33 * 2 * ((Price - MinL) / (MaxH - MinL) - .5) + .67 * Value1_1;
if(Value1 > .99)
Value1 = 9.999;
if(Value1 < -.99)
Value1 = -9.999;
Fish = .5 * Math.log((1 + Value1) / (1 - Value1)) + .5 * Fish_1;
Value1_1 = Value1;
if(getBarState() == BARSTATE_NEWBAR) {
temp = Fish_1;
Fish_1 = Fish;
}
return new Array(Fish,temp);
}
Comment