Hello
I am trying to write an efs for the following system of 4 moving averages with alert sounds for different situations.
A 3 and 5 period MA based on HLC/3 and an 8 period MA based on the High and a 10 period MA based on the Low.
1. When the 3 is above the 5 and both are above the 8 – sound an alert and when the 3 moves below the 5 while both still remaining above the 8 – sound an alert.
2. When the 3 is below the 5 when both are below the 10 – sound an alert and when the 3 moves above the 5 whilst both are still below the 10 –sound an alert.
3. When the 3 and the 5 are between the 8 and the 10 – also sound an alert. The relative order of the 3 & 5 when they are between the 8 and 10 is unimportant – only the fact that both are between the 8 & 10.
I have used Alexis’ ‘basicmax2(alert)’ as the basis for this purpose. I have not written any efs before except for some small cut and paste jobs. This is my first attempt at writing conditionals and statements and they could look rather clumsy and inefficient. I have used different sound alerts to check if the lines work. I know some do and some don’t –even if clumsily. I will adjust the number and type of sound alerts when the efs works properly.
Ideally I would like the alerts to sound only the first time when there are changes and then sound again when the condition changes [i.e., no alerts while the same condition continues] but that seems to be way over my head. As it stands the alerts sound on every bar.
My code is attached and I would appreciate any help from members and especially if Alexis has the time to cast his expert eye over my clumsy effort.
Thanks
I am trying to write an efs for the following system of 4 moving averages with alert sounds for different situations.
A 3 and 5 period MA based on HLC/3 and an 8 period MA based on the High and a 10 period MA based on the Low.
1. When the 3 is above the 5 and both are above the 8 – sound an alert and when the 3 moves below the 5 while both still remaining above the 8 – sound an alert.
2. When the 3 is below the 5 when both are below the 10 – sound an alert and when the 3 moves above the 5 whilst both are still below the 10 –sound an alert.
3. When the 3 and the 5 are between the 8 and the 10 – also sound an alert. The relative order of the 3 & 5 when they are between the 8 and 10 is unimportant – only the fact that both are between the 8 & 10.
I have used Alexis’ ‘basicmax2(alert)’ as the basis for this purpose. I have not written any efs before except for some small cut and paste jobs. This is my first attempt at writing conditionals and statements and they could look rather clumsy and inefficient. I have used different sound alerts to check if the lines work. I know some do and some don’t –even if clumsily. I will adjust the number and type of sound alerts when the efs works properly.
Ideally I would like the alerts to sound only the first time when there are changes and then sound again when the condition changes [i.e., no alerts while the same condition continues] but that seems to be way over my head. As it stands the alerts sound on every bar.
My code is attached and I would appreciate any help from members and especially if Alexis has the time to cast his expert eye over my clumsy effort.
Thanks
Comment