NexusFi: Find Your Edge


Home Menu

 





Help with adding an alert to an indicator


Discussion in EasyLanguage Programming

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




 
Search this Thread

Help with adding an alert to an indicator

(login for full post details)
  #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?
The space time continuum and the dynamics of a financial …
Emini and Emicro Index
ZombieSqueeze
Platforms and Indicators
Request for MACD with option to use different MAs for fa …
NinjaTrader
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
Futures Close-Out Policy
Commodities
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Just another trading journal: PA, Wyckoff & Trends
33 thanks
Daytrading ES & NQ
32 thanks
Spoo-nalysis ES e-mini futures S&P 500
28 thanks
Retail Trading As An Industry
24 thanks
Battlestations: Show us your trading desks!
24 thanks

(login for full post details)
  #2 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,429 since Apr 2013
Thanks Given: 479
Thanks Received: 1,619

Hi george10294,

welcome to futures.io. 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 Twitter Reply With Quote
The following user says Thank You to ABCTG for this post:
(login for full post details)
  #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
The following user says Thank You to george10294 for this post:





Last Updated on July 30, 2021


© 2024 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 - Privacy Policy - Downloads - Top
no new posts