Alerts for NT7 - futures io
futures io futures trading


Alerts for NT7

Alerts features of NT7 using an indicator, like TrendLineAlertCustom in Downloads, uses an Extended Line as the trigger and the Alert, Print and Say functions to communicate the message.

The following code is necessary:

 
Code
                            foreach (IDrawObject draw in DrawObjects)
     {
        if ((
draw.Tag.StartsWith("Trend Line")||draw.Tag.StartsWith("Resistance")||draw.Tag.StartsWith("Support")) &&draw is ILine)
          {
           
ILine drawnLine = (ILinedraw;    
           if(  
drawnLine.DrawType==DrawType.ExtendedLine||drawnLine.DrawType==DrawType.Line||drawnLine.DrawType==DrawType.HorizontalLine )
            {
                 
LineName=draw.Tag;
                
currentYdrawnLine.StartY+(drawnLine.StartBarsAgo)/(-drawnLine.EndBarsAgo+drawnLine.StartBarsAgo+.0000001)*(drawnLine.EndY-drawnLine.StartY);
    
Values[].Set(currentY);
            }  
    
//Price rising above the manually drawn Trend Line        
            
if((Close[]-currentY>&&lastprice-currentY<=))
            {    
Alert("Alert", Priority.HighInstrumentName+": $"+Close[]+", Rising Above Trendline "+LineNamesoundFileR1Color.BlackColor.Lime);
                Print(&
quot;TrendLineCustom " +InstrumentName+": $"+Close[]+", Rising Above  "+LineName);
                if(!
over)Say(InstrumentName+&quotcrossing ABOVE "+LineName+"   at   "+Close[]);
                
over=true;
            }
              
    
//Price falling below the manually drawn Trend Line        
            
if((Close[]-currentY<&&lastprice-currentY>=))
            
            {    
Alert("Alert", Priority.HighInstrumentName+": $"+Close[]+", Falling Below Trendline "+LineNamesoundFileF1Color.RedColor.Yellow);
                Print(&
quot;TrendLineCustom "+  InstrumentName+": $"+Close[]+", Falling Below  "+LineName+"   at  "+Close[]);    
                if(!
under)Say(InstrumentName+&quotcrossing BELOW "+LineName+"   at  "+Close[]);
                
under=true;
            }   
          }    
    
         } 

Contributors:  Big Mike ,  ZTR 

All times are GMT -4. The time now is 08:37 PM. (this page content is cached, log in for real-time version)

Copyright © 2019 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
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.