Could someone show me how to get my signals to update with each tick. Right now they come on and stay on even if the bar finishes without the conditions being met. Thanks for any help!
Steve
var vCCI = null;
function preMain() {
setPriceStudy(true);
setStudyTitle("CCI V -4 0" );
setShowCursorLabel(false);
setCursorLabelName("CCI V -4 0", 0);
setDefaultBarFgColor(Color.blue, 0);
var fp1 = new FunctionParameter("Length", FunctionParameter.NUMBER);
fp1.setLowerLimit(1);
fp1.setDefault(14); //Edit this value to set a new default
var fp2 = new FunctionParameter("Source", FunctionParameter.STRING);
fp2.setName("CCISource");
fp2.addOption("Close");
fp2.addOption("High");
fp2.addOption("Low");
fp2.addOption("Open");
fp2.addOption("HL/2");
fp2.addOption("HLC/3");
fp2.addOption("OHLC/4");
fp2.setDefault("Close"); //Edit this value to set a new default
}
function main(Length, Source, Upper, Lower) {
if (vCCI == null) vCCI = new CCIStudy(Length, Source);
/********************************************
Insert your code following this text block
Use vCCI.getValue(CCIStudy.CCI) for your code
*********************************************/
if(vCCI.getValue(CCIStudy.CCI,-4) < vCCI.getValue(CCIStudy.CCI,-3) &&
vCCI.getValue(CCIStudy.CCI,-3) > 100 &&
vCCI.getValue(CCIStudy.CCI,-3) < 190 &&
vCCI.getValue(CCIStudy.CCI,-2) < vCCI.getValue(CCIStudy.CCI,-3) &&
vCCI.getValue(CCIStudy.CCI,-2) > 0 &&
vCCI.getValue(CCIStudy.CCI,-1) < 0 &&
vCCI.getValue(CCIStudy.CCI) > 0 ) {
//Alert.playSound("C:\\Progam Files\\eSignal\\Sounds\\ding.wav");
//Alert.addToList(getSymbol(),"V -4 0",Color.black,Color.RGB(65,65,65));
drawShapeRelative(0, low()-1, Shape.SQUARE, "", Color.fushcia, Shape.TOP);
}
if(vCCI.getValue(CCIStudy.CCI,-4) > vCCI.getValue(CCIStudy.CCI,-3) &&
vCCI.getValue(CCIStudy.CCI,-3) < -100 &&
vCCI.getValue(CCIStudy.CCI,-3) > -190 &&
vCCI.getValue(CCIStudy.CCI,-2) > vCCI.getValue(CCIStudy.CCI,-3) &&
vCCI.getValue(CCIStudy.CCI,-2) < 0 &&
vCCI.getValue(CCIStudy.CCI,-1) > 0 &&
vCCI.getValue(CCIStudy.CCI) < 0 ) {
//Alert.playSound("C:\\Progam Files\\eSignal\\Sounds\\ding.wav");
//Alert.addToList(getSymbol(),"V -4 0",Color.black,Color.RGB(65,65,65));
drawShapeRelative(0, high()+1, Shape.SQUARE, "", Color.fushcia, Shape.BOTTOM);
} //closes the crossing down condition
return null;//new Array(vCCI.getValue(CCIStudy.CCI));
}
Steve
var vCCI = null;
function preMain() {
setPriceStudy(true);
setStudyTitle("CCI V -4 0" );
setShowCursorLabel(false);
setCursorLabelName("CCI V -4 0", 0);
setDefaultBarFgColor(Color.blue, 0);
var fp1 = new FunctionParameter("Length", FunctionParameter.NUMBER);
fp1.setLowerLimit(1);
fp1.setDefault(14); //Edit this value to set a new default
var fp2 = new FunctionParameter("Source", FunctionParameter.STRING);
fp2.setName("CCISource");
fp2.addOption("Close");
fp2.addOption("High");
fp2.addOption("Low");
fp2.addOption("Open");
fp2.addOption("HL/2");
fp2.addOption("HLC/3");
fp2.addOption("OHLC/4");
fp2.setDefault("Close"); //Edit this value to set a new default
}
function main(Length, Source, Upper, Lower) {
if (vCCI == null) vCCI = new CCIStudy(Length, Source);
/********************************************
Insert your code following this text block
Use vCCI.getValue(CCIStudy.CCI) for your code
*********************************************/
if(vCCI.getValue(CCIStudy.CCI,-4) < vCCI.getValue(CCIStudy.CCI,-3) &&
vCCI.getValue(CCIStudy.CCI,-3) > 100 &&
vCCI.getValue(CCIStudy.CCI,-3) < 190 &&
vCCI.getValue(CCIStudy.CCI,-2) < vCCI.getValue(CCIStudy.CCI,-3) &&
vCCI.getValue(CCIStudy.CCI,-2) > 0 &&
vCCI.getValue(CCIStudy.CCI,-1) < 0 &&
vCCI.getValue(CCIStudy.CCI) > 0 ) {
//Alert.playSound("C:\\Progam Files\\eSignal\\Sounds\\ding.wav");
//Alert.addToList(getSymbol(),"V -4 0",Color.black,Color.RGB(65,65,65));
drawShapeRelative(0, low()-1, Shape.SQUARE, "", Color.fushcia, Shape.TOP);
}
if(vCCI.getValue(CCIStudy.CCI,-4) > vCCI.getValue(CCIStudy.CCI,-3) &&
vCCI.getValue(CCIStudy.CCI,-3) < -100 &&
vCCI.getValue(CCIStudy.CCI,-3) > -190 &&
vCCI.getValue(CCIStudy.CCI,-2) > vCCI.getValue(CCIStudy.CCI,-3) &&
vCCI.getValue(CCIStudy.CCI,-2) < 0 &&
vCCI.getValue(CCIStudy.CCI,-1) > 0 &&
vCCI.getValue(CCIStudy.CCI) < 0 ) {
//Alert.playSound("C:\\Progam Files\\eSignal\\Sounds\\ding.wav");
//Alert.addToList(getSymbol(),"V -4 0",Color.black,Color.RGB(65,65,65));
drawShapeRelative(0, high()+1, Shape.SQUARE, "", Color.fushcia, Shape.BOTTOM);
} //closes the crossing down condition
return null;//new Array(vCCI.getValue(CCIStudy.CCI));
}
Comment