Is there an ESF that allows you to set a specific point for alarm (i.e. the pivot point, or other points of support and resistance?) MK
Announcement
Collapse
No announcement yet.
Specific point alarms
Collapse
X
-
Please try this formula.
PHP Code:/*
Copyright © eSignal, 2003
Title: Alert at X
Version: 1.0
=============================================
Fix History:
=============================================
Project Description:
This formula will provide an alert at a given price level.
=============================================
Notes:
Please note that the price level must be defined in the Edit Studies window
before any alert is given. If multiple alerts are needed, please create
another instance of the formula.
Once the alert is hit, the formula must be reloaded to reset the alert.
*/
vInit = false;
var PriceLevel = null;
var vAlertTriggered = false;
function preMain() {
if (vInit == false) {
setPriceStudy(true);
setStudyTitle("Alert at X");
setShowCursorLabel(false);
var fp1 = new FunctionParameter("PriceLevel", FunctionParameter.NUMBER);
var fp1a = new FunctionParameter("HiLo", FunctionParameter.STRING);
fp1a.setName("Alert Type?");
fp1a.addOption("At_Or_Above");
fp1a.addOption("At_Or_Below");
fp1a.setDefault("At_Or_Above"); //Edit this value to set a new default
var fp2 = new FunctionParameter("Popup", FunctionParameter.BOOLEAN);
fp2.setName("Pop-up Alert?");
fp2.setDefault(true);
var fp3 = new FunctionParameter("Sound", FunctionParameter.BOOLEAN);
fp3.setName("Sound Alert?");
fp3.setDefault(true);
var fp4 = new FunctionParameter("Email", FunctionParameter.BOOLEAN);
fp4.setName("Email Alert?");
fp4.setDefault(false);
vInit = true;
} else if (vInit == true) setStudyTitle("Alert at " + PriceLevel);
}
function main(PriceLevel,HiLo,Popup,Sound,Email) {
if (PriceLevel == null || vAlertTriggered) return;
if (HiLo == "At_Or_Above") {
if (close() >= PriceLevel) {
if (Popup) Alert.addToList(getSymbol(), "ALERT: " + getSymbol() + " >= " + PriceLevel);
if (Sound) Alert.playSound(ding.wav);
if (Email) Alert.email(getSymbol(), "ALERT: " + getSymbol() + " >= " + PriceLevel);
vAlertTriggered = true;
}
} else if (HiLo == "At_Or_Below") {
if (close() <= PriceLevel) {
if (Popup) Alert.addToList(getSymbol(), "ALERT: " + getSymbol() + " <= " + PriceLevel);
if (Sound) Alert.playSound(ding.wav);
if (Email) Alert.email(getSymbol(), "ALERT: " + getSymbol() + " <= " + PriceLevel);
vAlertTriggered = true;
}
}
return;
}
Attached FilesRegards,
Jay F.
Product Manager
_____________________________________
Have a suggestion to improve our products?
Click Support --> Request a Feature in eSignal 11
Comment
-
Hello Carlton,
I made some minor changes to this formula. It should work for you now. The sound file names need to be strings. That was the main problem. I also added some logic to allow only one alert per bar. Let me know if this helps.Attached FilesJason K.
Project Manager
eSignal - an Interactive Data company
EFS KnowledgeBase
JavaScript for EFS Video Series
EFS Beginner Tutorial Series
EFS Glossary
Custom EFS Development Policy
New User Orientation
Comment
-
Hi JayF,
Would it be possible to make this Alert at X EFS automatically inherit its alert value from another efs value? Specifically I'm wondering if it would be possible to have an auto-alert generated that sounded when a Support or Resistance level generated from a Pivots EFS was broken. Right now of course I can instance your script multiple times manually for each day's pivots, but I was just curious to know if this could somehow be automated.
Thanks for the help!
Jonathan
Comment
-
Hello Jonathan,
This is possible. What you would need to do is incorporate the setGlobalValue( varname, value ) function into the pivot EFS to pass some value or true/false to the global space. Then in your alert formula, use getGlobalValue( varname ) to detect the event and trigger the alert.Jason K.
Project Manager
eSignal - an Interactive Data company
EFS KnowledgeBase
JavaScript for EFS Video Series
EFS Beginner Tutorial Series
EFS Glossary
Custom EFS Development Policy
New User Orientation
Comment
-
If using eSignal build 723 (or later) download the attached revision of alert at x.efs which includes the changes required by the FunctionParameter BOOLEAN fix
AlexAttached Files
Comment
-
Alex,
Thank you very much. This is exactly what I was looking for. I appreciate all your help, not just with this question, but the previous ones all.
-Nick" If a man didn't make mistakes he'd own the world in a month. But if he didn't profit from his mistakes, he wouldn't own a blessed thing."
-Jesse Livermore
Comment
-
Nick
As far as I can see it is working properly when set to At_or_Above
Alex
Originally posted by Trader273
Alex,
I came across a small problem that you might be able to help me with. The EFS that you directed me to works very well. The only problem that occurs is when I have the settings set to " At or Above" the designated price. When i have this set and the price exceeds my designated price i dont get an alarm. (ex. alert set at 2.75, at or above. Price is at 2.83, but no alert was generated. Don't understand this since when i have th settings set to "At or Below" it works to perfection. Any ideas??
thanks
-Nick
Comment
-
Alex,
Thanks. I was using candles instead of bars and that fixed the problem. Thats why I deleted my questiion, but you answered it faster then i could delete it. Thanks for the help though.
Nick" If a man didn't make mistakes he'd own the world in a month. But if he didn't profit from his mistakes, he wouldn't own a blessed thing."
-Jesse Livermore
Comment
-
Nick
It will work also with candlesticks.
Alex
Originally posted by Trader273
Alex,
Thanks. I was using candles instead of bars and that fixed the problem. Thats why I deleted my questiion, but you answered it faster then i could delete it. Thanks for the help though.
Nick
Comment
Comment