Alex-
line 30: missing } after function body:
return;
line 30: missing } after function body:
return;
function preMain() {
setPriceStudy(true);
setStudyTitle("3bar range");
setShowCursorLabel(false);
setColorPriceBars(true);
setDefaultPriceBarColor(Color.black);
}
var lastrawtime = 0;
var BarCount = 0;
function main() {
if (lastrawtime != getValue("rawtime", 0)) {
BarCount += 1;
lastrawtime = getValue("rawtime", 0);
}
if(close(-2)>open(-2)&&close(-2)>close(-3)&&high(-2)>high(-3)&&
close(-1)>open(-1)&&close(-1)>close(-2)&&high(-1)>high(-2)&&
close(0)<open(0)&&close(0)<close(-2)&&high(0)<high(-1)){
setPriceBarColor(Color.magenta);
}else if(close(-2)<open(-2)&&close(-2)<close(-3)&&low(-2)<low(-3)&&
close(-1)<open(-1)&&close(-1)<close(-2)&&low(-1)<low(-2)&&
close(0)>open(0)&&close(0)>close(-2)&&low(0)>low(-1)){
setPriceBarColor(Color.green);
}else if((high(0)-low(0))<(high(-1)-low(-1))&&(high(-1)-low(-1))<(high(-2)-low(-2))){
setPriceBarColor(Color.blue);
}else if(high(0)>high(-1)&&low(0)<low(-1)){
setPriceBarColor(Color.cyan);
}else if(close(0)>open(0)){
setPriceBarColor(Color.lime);
}else if(close(0)<open(0)){
setPriceBarColor(Color.red);
}
if(close(-2)>open(-2)&&close(-2)>close(-3)&&high(-2)>high(-3)&&
close(-1)>open(-1)&&close(-1)>close(-2)&&high(-1)>high(-2)&&
close(0)<open(0)&&close(0)<close(-2)&&high(0)<high(-1)){
drawTextRelative(0,high(0),"l",Color.red,null,Text.BOTTOM|Text.CENTER,"Wingdings",8,"Dn"+ BarCount);
}else{
removeText("Dn"+BarCount);
}
if(close(-2)<open(-2)&&close(-2)<close(-3)&&low(-2)<low(-3)&&
close(-1)<open(-1)&&close(-1)<close(-2)&&low(-1)<low(-2)&&
close(0)>open(0)&&close(0)>close(-2)&&low(0)>low(-1)){
drawTextRelative(0,low(0),"l",Color.green,null,Text.TOP|Text.CENTER,"Wingdings",8,"Up"+ BarCount);
}else{
removeText("Up"+BarCount);
}
return;
}
function preMain() {
setPriceStudy(true);
setStudyTitle("3bar range");
setShowCursorLabel(false);
setColorPriceBars(true);
setDefaultPriceBarColor(Color.black);
}
var lastrawtime = 0;
var BarCount = 0;
function main() {
if(lastrawtime != getValue("rawtime", 0)){
BarCount += 1;
lastrawtime = getValue("rawtime", 0);
}
if(close(-2)>open(-2)&&close(-2)>close(-3)&&high(-2)>high(-3)&&
close(-1)>open(-1)&&close(-1)>close(-2)&&high(-1)>high(-2)&&
close(0)<open(0)&&close(0)<close(-2)&&high(0)<high(-1)){
setPriceBarColor(Color.magenta);
}else if(close(-2)<open(-2)&&close(-2)<close(-3)&&low(-2)<low(-3)&&
close(-1)<open(-1)&&close(-1)<close(-2)&&low(-1)<low(-2)&&
close(0)>open(0)&&close(0)>close(-2)&&low(0)>low(-1)){
setPriceBarColor(Color.green);
}else if((high(0)-low(0))<(high(-1)-low(-1))&&(high(-1)-low(-1))<(high(-2)-low(-2))){
setPriceBarColor(Color.blue);
}else if(high(0)>high(-1)&&low(0)<low(-1)){
setPriceBarColor(Color.cyan);
}else if(close(0)>open(0)){
setPriceBarColor(Color.lime);
}else if(close(0)<open(0)){
setPriceBarColor(Color.red);
}
if(close(-2)>open(-2)&&close(-2)>close(-3)&&high(-2)>high(-3)&&
close(-1)>open(-1)&&close(-1)>close(-2)&&high(-1)>high(-2)&&
close(0)<open(0)&&close(0)<close(-2)&&high(0)<high(-1)){
drawTextRelative(0,high(0),"l",Color.red,null,Text.BOTTOM|Text.CENTER,"Wingdings",8,"Dn"+ BarCount);
}else{
removeText("Dn"+BarCount);
}
if(close(-2)<open(-2)&&close(-2)<close(-3)&&low(-2)<low(-3)&&
close(-1)<open(-1)&&close(-1)<close(-2)&&low(-1)<low(-2)&&
close(0)>open(0)&&close(0)>close(-2)&&low(0)>low(-1)){
drawTextRelative(0,low(0),"l",Color.green,null,Text.TOP|Text.CENTER,"Wingdings",8,"Up"+ BarCount);
}else{
removeText("Up"+BarCount);
}
if(high(0)>=high(-1)&&close(0)<close(-1)&&close(0)<close(-2)){
drawTextRelative(0,high(0),"l",Color.red,null,Text.BOTTOM|Text.CENTER,"Wingdings",8,"Dn2"+ BarCount);
}else{
removeText("Dn2"+BarCount);
}
if(low(0)<=low(-1)&&close(0)>close(-1)&&close(0)>close(-2)){
drawTextRelative(0,low(0),"l",Color.green,null,Text.TOP|Text.CENTER,"Wingdings",8,"Up2"+ BarCount);
}else{
removeText("Up2"+BarCount);
}
return;
}
Comment