View Single Post
  #112 (permalink)  
Old 04-09-2006, 11:40 AM
elihayun's Avatar
elihayun elihayun is offline
Senior Member
 
Join Date: Jan 2006
Posts: 377
elihayun is on a distinguished road
How to add alarm to any indicator

Hi
I see a lot of people here asking to add alarm when an indicator is light up. Especially when a arrow/bullet is turn on.

Actually, it is very simple task. All you have to do is follow the following instructions.

1) Every indicator has an indicator array that keep the values of the indicator. Values can be 0 or not 0. To find out the indicator name look for the command: SetIndexBuffer
In the indicator editor it should look like this

SetIndexBuffer(0,ExtMapBuffer);
SetIndexBuffer(1,ExtMapBuffer2);

This lines tell us that we have 2 indicator buffers

2) Look when the indicator buffer change its value.
In the example above we will look to line that contains the following patter:
ExtMapBuffer[number] = where number can be a figure or a name. For example: if(res!=0.0) ExtMapBuffer[shift]=res;
if after the equal sign there is 0 do nothing.

3) Change it to make an alarm.
After finding the value setting line we will add an alarm to it.
a) add { before the setting. In the example above :
if(res!=0.0) {ExtMapBuffer[shift]=res;
b) add the Alert command after the ;. In the example above:
if(res!=0.0) { ExtMapBuffer[shift]=res;
Alert("Indicator set");
}

Do not forget to close the }


4) repeat for every buffer value setting


Compile and you have an indicator with alert

Hope it will help you
Reply With Quote