Hi,
I have nearly completed my EFS, but have got a little stuck on drawing arrows. I have succesfully got the software to trigger the arrow and draw it in the right place, however, when a new bar is created, the arrow just dissappears and the whole thing starts over again. What I want is for the arrow to stay at its relative X-axis position and remain there at that bar. I have tried both Absolute and Relative but neither give me the results I am looking for, so I guess I am doing something wrong. Below is the section of code I am referring to, all help would be appreciated:
if (getBarState () == BARSTATE_NEWBAR)
vFlag = false;
if (sDisplayPrice < DnDegrees){
setBar(Bar.FgColor,-1, Color.black);}
if (sDisplayPrice > DnDegrees && sDisplayPrice < UpDegrees){
setBar(Bar.FgColor, -1, Color.blue);}
if (sDisplayPrice > UpDegrees){
setBar(Bar.FgColor,-1, Color.white);
}
if ( vClose > HighLinearRegValue && sDisplayPrice > DnDegrees){
drawShapeRelative(0, vLow - (1 / Multi), Shape.UPARROW, null, Color.lime, Image.ONTOP, "up");
if (vFlag == false) Alert.playSound("warning.wav")
vFlag = true
}
if ( vClose < LowLinearRegValue && sDisplayPrice < UpDegrees){
drawShapeRelative(0, vHigh + (1 / Multi), Shape.DOWNARROW, null, Color.red, Image.ONTOP, "dn");
if (vFlag == false) Alert.playSound("warning.wav")
vFlag = true
}
if ( vClose > LowLinearRegValue && vClose < HighLinearRegValue){
removeShape("up")
removeShape("dn")}
I have nearly completed my EFS, but have got a little stuck on drawing arrows. I have succesfully got the software to trigger the arrow and draw it in the right place, however, when a new bar is created, the arrow just dissappears and the whole thing starts over again. What I want is for the arrow to stay at its relative X-axis position and remain there at that bar. I have tried both Absolute and Relative but neither give me the results I am looking for, so I guess I am doing something wrong. Below is the section of code I am referring to, all help would be appreciated:
if (getBarState () == BARSTATE_NEWBAR)
vFlag = false;
if (sDisplayPrice < DnDegrees){
setBar(Bar.FgColor,-1, Color.black);}
if (sDisplayPrice > DnDegrees && sDisplayPrice < UpDegrees){
setBar(Bar.FgColor, -1, Color.blue);}
if (sDisplayPrice > UpDegrees){
setBar(Bar.FgColor,-1, Color.white);
}
if ( vClose > HighLinearRegValue && sDisplayPrice > DnDegrees){
drawShapeRelative(0, vLow - (1 / Multi), Shape.UPARROW, null, Color.lime, Image.ONTOP, "up");
if (vFlag == false) Alert.playSound("warning.wav")
vFlag = true
}
if ( vClose < LowLinearRegValue && sDisplayPrice < UpDegrees){
drawShapeRelative(0, vHigh + (1 / Multi), Shape.DOWNARROW, null, Color.red, Image.ONTOP, "dn");
if (vFlag == false) Alert.playSound("warning.wav")
vFlag = true
}
if ( vClose > LowLinearRegValue && vClose < HighLinearRegValue){
removeShape("up")
removeShape("dn")}
Comment