PureBytes Links
Trading Reference Links
|
This is not for the faint of heart...
I took the volume indicator TS provides and added an alert and an input for the
alert (code below). I place the indicator on a 4000 tick bar chart. Since the
volume is 4000 ticks for every bar, I scale the indicator 1-4000 in the format
window. My alert input is at 3900. I want an alarm to sound when there are 3900
ticks of the bar.
If the alert is not enabled, the indicator works fine cycling from the bottom
of the histogram to the top and then onto a new histogram bar. If I enable the
alert for a pop up window with no sound, the alert also worked fine.
Then I set the enabled alert to sound a whistle and no pop up window. When the
indicator hits 3900, the indicator freezes at 3900 and no alarm sounds. If I
then go to format the indicator, the scale has somehow reset itself to -1 to 1.
I reset the scale and the indicator is no longer frozen. If I disable the
alert, the indicator works fine. If I enable the alert, it freezes up again at
3900 and the scale resets with no alarm sounded. Other alerts in other windows
all work as expected.
I have done the routine several times of going into regedit and deleting alert
"state" and message "state" folders. This does nothing. I've tried deleting the
window and setting up a new one. No help. This one boggles me. Any insights
would be appreciated.
input: AlertLevel(400);
if BarType >= 2 then begin { ie, not tick or minute bars }
Plot1( Volume, "Volume" );
if Volume = AlertLevel then alert = true;
end else begin { if tick or minute bars }
Plot1(UpTicks + DownTicks, "Volume" );
if UpTicks + DownTicks = AlertLevel then alert = true;
end;
|