Lots of times we are looking for signals and create colored bars/dots/etc to show the trade points.
Here is a little snippet of a neat way I show the signals, in this case the indicator crosses up or down through a certain value.
This code
if(stoch1>pt2 && stoch<pt2){
setBarBgColor( Color.lime );
drawShapeRelative(+0, stoch, Shape.CIRCLE, null, Color.black, Shape.TOP|Shape.ONTOP);
drawShapeRelative(-1, stoch1, Shape.CIRCLE, null, Color.black, Shape.TOP|Shape.ONTOP);
}
if(stoch1<pt8 && stoch>pt8){
setBarBgColor( Color.red );
drawShapeRelative(+0, stoch, Shape.CIRCLE, null, Color.black, Shape.TOP|Shape.ONTOP);
drawShapeRelative(-1, stoch1, Shape.CIRCLE, null, Color.black, Shape.TOP|Shape.ONTOP);
}
produces this chart effect
Here is a little snippet of a neat way I show the signals, in this case the indicator crosses up or down through a certain value.
This code
if(stoch1>pt2 && stoch<pt2){
setBarBgColor( Color.lime );
drawShapeRelative(+0, stoch, Shape.CIRCLE, null, Color.black, Shape.TOP|Shape.ONTOP);
drawShapeRelative(-1, stoch1, Shape.CIRCLE, null, Color.black, Shape.TOP|Shape.ONTOP);
}
if(stoch1<pt8 && stoch>pt8){
setBarBgColor( Color.red );
drawShapeRelative(+0, stoch, Shape.CIRCLE, null, Color.black, Shape.TOP|Shape.ONTOP);
drawShapeRelative(-1, stoch1, Shape.CIRCLE, null, Color.black, Shape.TOP|Shape.ONTOP);
}
produces this chart effect
Comment