I know this code works for just creating 1 event per new bar,
if (getBarState() == BARSTATE_NEWBAR) {
vFlag = false;
var vData1 = 5;
var vData2 = 1;
if (vData1 > vData2 && vFlag == false) {
Alert.playSound(vSFREV);
vFlag = true;
}
}
But I need a few more signals/alerts, say the first 5 of a new bar.
Better yet, it would be nice to have 5 alerts/signals but every 5th tick, so they are spread out a bit (every 5 ticks) instead of 5 in rapid suicession one right after anoteher with no pause.
How would you add code to do this? Whatever I have tried, has not worked.
if (getBarState() == BARSTATE_NEWBAR) {
vFlag = false;
var vData1 = 5;
var vData2 = 1;
if (vData1 > vData2 && vFlag == false) {
Alert.playSound(vSFREV);
vFlag = true;
}
}
But I need a few more signals/alerts, say the first 5 of a new bar.
Better yet, it would be nice to have 5 alerts/signals but every 5th tick, so they are spread out a bit (every 5 ticks) instead of 5 in rapid suicession one right after anoteher with no pause.
How would you add code to do this? Whatever I have tried, has not worked.
Comment