Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

HELP LineAlerts

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    HELP LineAlerts

    I am using the LineAlerts from the Ninjascript share site and am having a problem with the Ray and extended lines on the charts that don't send an alert when triggered and gives an error message on the chart "Check start & end points. Not eligible for alert. " It doesn't give the error on just a regular line that slopes but is a lot more convenient to draw a Ray or extended line
    I don't know how to code but I'm thinking maybe this part has something to do with it?

    Code:
    	//No Alert handling here. 					
    					if ((leftBarsAgo < 0 && rightBarsAgo < 0) || (leftBarsAgo > 0 && rightBarsAgo > 0) && draw.DrawType != DrawType.HorizontalLine )
    						DrawTextFixed("noAlert", "Check start & end points. Not eligible for alert. ", TextPosition.TopLeft);
    					
    					else if (leftBarsAgo == rightBarsAgo && draw.DrawType != DrawType.HorizontalLine)
    						DrawTextFixed("noAlert", "Not eligible for alert. No alerts for vertical lines", TextPosition.TopLeft);
    	
    					else
    					{			
    						//Alert Checking is done here. Can add your own actions to the block if desired. 
    						if(CrossBelow(Close, lineValueAtLastBar, 1) || CrossAbove(Close, lineValueAtLastBar, 1))
    						{
    							Alert("AlertLineCrossing", Cbi.Priority.High, alertMessage, soundFile, 0, Color.White, Color.Black);
    Is there a way to change this as to allow the Ray lines to function?

    Thanks
    Attached Files

    #2
    Hello geotabs,

    Thank you for the post.

    Yes, it appears that how this item is programmed it prevents its self from using Ray objects or other objects that extend to the panel edge unless they are drawn past the current bar. Although the ray is extending to the edge, its end anchor is likely being placed behind the current price which is invalid. If you instead make sure to draw the end anchor at the current bar, I see that it is used for alerts or the message is no longer present.

    I look forward to being of further assistance.

    Comment


      #3
      Thanks for the reply but is there a way to code this so as not to always have to reset anchor to current bar?

      Comment


        #4
        Hello geotabs,

        Thank you for the reply.

        Yes, very likely but this is not how the author had created this item specifically.

        With this item, you would need to ensure the anchors are in a position that the indicator sees as a valid position for its alerts. For this to update automatically, the script would need to either draw the object its self or edit the objects anchor points to advance it on each bar. This is not necessarily something I could provide specific details on what would need to be changed for that to occur, this would be something that needs to be developed and tested if that is the expected outcome.

        If you are interested in editing the script yourself to make it work more closely to what you want, I could provide more details on areas of interest in the script or provide further information on getting started in developing NinjaScript items. Alternatively, NT8 now has a built-in alert system which would work with Rays.



        I look forward to being of further assistance.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        579 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        334 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        101 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        554 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        551 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X