AlertEvent
Here is an example script that you can benefit from and run with to implement
having a News story alert paint the current bar on a chart.
begin
if who=0 then AlertEvent(eNews,69);
if who=1 then IT:='IBM test story';
if (who=1) or (who=69) then begin
writeln(IT);
if pos('IBM',IT) then if FindWindow(eChart,'IBM.1') then
SetBar(eColor,BarEnd,clRed);
if pos('(GM)',IT) then if FindWindow(eChart,'GM.1') then
SetBar(eColor,BarEnd,clRed);
if pos('(LU)',IT) then if FindWindow(eChart,'LU.1') then
SetBar(eColor,BarEnd,clRed);
end;
end;
Click the Run button to activate the AlertEvent.
Click button #1 to test the color bar mechanism on the IBM.1 minute chart.
The News Alert list would have symbols as keywords, perhaps in parenthesis
like (LU).
When a news alert triggers, ESPL will be called with Who=69 and you can then
test the contents of the IT variable to see what action you want to take.
I have illustrated setting the color of the last bar on the IBM.1 chart if this
chart is currently displayed, etc.
|