NexusFi: Find Your Edge


Home Menu

 





Help with adding an alert to an indicator


Discussion in EasyLanguage Programming

Updated
    1. trending_up 3,140 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

  #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?
ZombieSqueeze
Platforms and Indicators
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
Exit Strategy
NinjaTrader
My NT8 Volume Profile Split by Asian/Euro/Open
NinjaTrader
NexusFi Journal Challenge - April 2024
Feedback and Announcements
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Get funded firms 2023/2024 - Any recommendations or word …
61 thanks
Funded Trader platforms
39 thanks
NexusFi site changelog and issues/problem reporting
26 thanks
The Program
18 thanks
GFIs1 1 DAX trade per day journal
18 thanks
  #2 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,431 since Apr 2013
Thanks Given: 481
Thanks Received: 1,623

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
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


© 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