I am trying to get the following formula to work but something is not quite correct.
In one single study pane I will have two study lines based off the following two formulas.
Indicator 1 Color.red)
A 3 bar simple smoothed average of the following;
{[[Highest(High(ofpast5bars))-Open(5barsago)]+[Close(current)-Lowest(Low(ofpast5bars))]]*100}
all divided by {[(Highest(High(ofpast5bars)-Lowest(Low(ofpast5bars))]*2}
Indicator 2 Color.blue)
{[Close(current)-Lowest(Low(ofpast5bars)]*100}
all divided by {Highest(High(ofpast5bars)-Lowest(Low(ofpast5bars)}
PS It should also have a black color line at 50% mark.
Here is my attempt at EFS but I am not getting the following formula to work and would
sincerely appreciate the assistance to get this working
function preMain() {
setPriceStudy(false);
setStudyTitle("LSS",0);
setStudyTitle("SI",1);
setDefaultBarFgColor(Color.red,0);
setDefaultBarFgColor(Color.blue,1);
setPlotType(PLOTTYPE_LINE,0);
setPlotType(PLOTTYPE_LINE,1);
addBand(50,PS_SOLID,1,Color.black);
}
function main() {
if(vLSS == null && vSI == null);
var vC1 = close(0);
var vO1 = open(-5);
var vH1 = Math.max(high(),high(-1),high(-2),high(-3),high(-4));
var vL1 = Math.min(low(),low(-1),low(-2),low(-3),low(-4));
var vLSSp = ((((vH1 - vO1)+(vC1 - vL1))*100)/((vH1 - vL1)*2));
var vLSSa = vLSSp(-1);
var vLSSb = vLSSp(-2);
var vLSSc = ((vLSSp+vLSSa+vLSSb)/3);
var vLSS = study1.getValue("vLSSc");
var vSIc = (((vC1 - vL1)*100)/(vH1 - vL1))
var vSI = study2.getValue("vSIc");
return new Array(vLSS,vSI);
}
//Regards Kevan
In one single study pane I will have two study lines based off the following two formulas.
Indicator 1 Color.red)
A 3 bar simple smoothed average of the following;
{[[Highest(High(ofpast5bars))-Open(5barsago)]+[Close(current)-Lowest(Low(ofpast5bars))]]*100}
all divided by {[(Highest(High(ofpast5bars)-Lowest(Low(ofpast5bars))]*2}
Indicator 2 Color.blue)
{[Close(current)-Lowest(Low(ofpast5bars)]*100}
all divided by {Highest(High(ofpast5bars)-Lowest(Low(ofpast5bars)}
PS It should also have a black color line at 50% mark.
Here is my attempt at EFS but I am not getting the following formula to work and would
sincerely appreciate the assistance to get this working
function preMain() {
setPriceStudy(false);
setStudyTitle("LSS",0);
setStudyTitle("SI",1);
setDefaultBarFgColor(Color.red,0);
setDefaultBarFgColor(Color.blue,1);
setPlotType(PLOTTYPE_LINE,0);
setPlotType(PLOTTYPE_LINE,1);
addBand(50,PS_SOLID,1,Color.black);
}
function main() {
if(vLSS == null && vSI == null);
var vC1 = close(0);
var vO1 = open(-5);
var vH1 = Math.max(high(),high(-1),high(-2),high(-3),high(-4));
var vL1 = Math.min(low(),low(-1),low(-2),low(-3),low(-4));
var vLSSp = ((((vH1 - vO1)+(vC1 - vL1))*100)/((vH1 - vL1)*2));
var vLSSa = vLSSp(-1);
var vLSSb = vLSSp(-2);
var vLSSc = ((vLSSp+vLSSa+vLSSb)/3);
var vLSS = study1.getValue("vLSSc");
var vSIc = (((vC1 - vL1)*100)/(vH1 - vL1))
var vSI = study2.getValue("vSIc");
return new Array(vLSS,vSI);
}
//Regards Kevan
Comment