NexusFi: Find Your Edge


Home Menu

 





Help with adding an alert to an indicator


Discussion in EasyLanguage Programming

Updated
    1. trending_up 4,016 views
    2. thumb_up 2 thanks given
    3. group 2 followers
    1. forum 2 posts
    2. attach_file 0 attachments




 
Search this Thread
  #1 (permalink)
george10294
Los Angeles, CA
 
Posts: 2 since Jul 2021
Thanks Given: 1
Thanks Received: 1

Hello. I’m having a problem figuring out how to add an alert to a simple indicator. I’ve looked around the web and read through easylanguage manuals and can’t find the exact solution so I thought I’d ask here.

Here is the code for the indicator. It is simple and just measures the change in price for a stock for X number of minutes. The example below is coded for 2 minutes (setting Timeframe to minutes)

Vars: cng(0);

cng = ((close / close[2] ) -1 ) ;
If Close[1] > 0 then
cng = ((Close / Close[2] ) -1 ) ;

Plot1(cng);

If Plot1 > 0 then
SetPlotColor(1, GREEN)
Else
SetPlotColor(1, RED);


I am just trying to add an alert to this so that it will alert me when the price change over X minutes is > 10%, or 12%... etc.

Can anyone assist? Thank you.


Reply With Quote

Can you help answer these questions
from other members on NexusFi?
EA
Platforms and Indicators
Datafeed for Atas
Platforms and Indicators
Trump Media to sell instant access to market-moving soci …
Traders Hideout
requesting .nrd replay files from 2026 spy and qqq
The Elite Circle
No book, only a stair: journaling fills where price move …
Cryptocurrency
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Mes vs MNQ
6 thanks
NexusFi site changelog and issues/problem reporting
5 thanks
BERN ALGOS algo trading journal
3 thanks
Johnnys Journal
2 thanks
TopStep Trader disappointment
2 thanks
  #2 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,448 since Apr 2013
Thanks Given: 494
Thanks Received: 1,643

Hi george10294,

welcome to NexusFi. Take a look at the built-in RSI indicator. This demonstrates how you can trigger an alert on a cross over/under a threshold.

Regards,

ABCTG


george10294 View Post
Hello. I’m having a problem figuring out how to add an alert to a simple indicator. I’ve looked around the web and read through easylanguage manuals and can’t find the exact solution so I thought I’d ask here.

Here is the code for the indicator. It is simple and just measures the change in price for a stock for X number of minutes. The example below is coded for 2 minutes (setting Timeframe to minutes)

Vars: cng(0);

cng = ((close / close[2] ) -1 ) ;
If Close[1] > 0 then
cng = ((Close / Close[2] ) -1 ) ;

Plot1(cng);

If Plot1 > 0 then
SetPlotColor(1, GREEN)
Else
SetPlotColor(1, RED);


I am just trying to add an alert to this so that it will alert me when the price change over X minutes is > 10%, or 12%... etc.

Can anyone assist? Thank you.


Follow me on X Reply With Quote
Thanked by:
  #3 (permalink)
george10294
Los Angeles, CA
 
Posts: 2 since Jul 2021
Thanks Given: 1
Thanks Received: 1


Thank you ABCTG.

This is what I came up with.


Vars: cng(0);

cng = ((close / close[5] ) -1 ) ;
If Close[1] > 0 then
cng = ((Close / Close[5] ) -1 ) ;

Plot1(cng);

If Plot1 > 0 then
SetPlotColor(1, GREEN)
Else
SetPlotColor(1, RED);

Inputs:

HiAlert( 0 ) [DisplayName = "HiAlert",
ToolTip = "Enter percentage amount above which an alert will be triggered. Example: 10."];

{ alert criteria }
if AlertEnabled then
begin
if cng crosses over HiAlert then
Alert( !( "Bullish alert" ) );
end;




Not sure if this is clean, but it seems to work as I intended. Thanks again.


Reply With Quote
Thanked by:




Last Updated on July 30, 2021


© 2026 NexusFi®, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Downloads - Top
no new posts