Thanks for encouraging smile,all i want ..... a new life to half trend indicator created by your own idea and logic along with a multi dimensional lay out possibilities :):)
Let me try this way :
If that is the question, then, you need to have two "trend" buffers, not 1 (since - when ShowNetWick is set to false) wicks can exceed atr lines at same time (on same bar).
If that is the question, then, you need to have two "trend" buffers, not 1 (since - when ShowNetWick is set to false) wicks can exceed atr lines at same time (on same bar). Also I fail to see the logic of the net wick it is made now. If it should show the total wick (upper + lower wick) then it is made wrong, since it does not do that way now. The way it is made now it is showing the difference of two wicks. Is that what it was supposed to show?
In that case the alerts are working as you described (ie : the first time the "trend" is changed - upper wick breaks upper band or lower wick breaks lower band - it will alert you). If you want it to alert you on each break of the bands change line 129 from this :
trend[pos] = trend[pos+1];
to this :
trend[pos] = 0;
and also change the alerting code to this :
int whichBar = 0;
else whichBar = 1;
if (trend[whichBar] != trend[whichBar+1])
if (trend[whichBar] == 1) doAlert("Buy");
if (trend[whichBar] == -1) doAlert("Sell");
and then it will alert you one each and every break of the atr band