Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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.
    JesseNinjaTrader Customer Service

    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.
        JesseNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by bortz, 11-06-2023, 08:04 AM
        47 responses
        1,602 views
        0 likes
        Last Post aligator  
        Started by jaybedreamin, Today, 05:56 PM
        0 responses
        8 views
        0 likes
        Last Post jaybedreamin  
        Started by DJ888, 04-16-2024, 06:09 PM
        6 responses
        18 views
        0 likes
        Last Post DJ888
        by DJ888
         
        Started by Jon17, Today, 04:33 PM
        0 responses
        4 views
        0 likes
        Last Post Jon17
        by Jon17
         
        Started by Javierw.ok, Today, 04:12 PM
        0 responses
        12 views
        0 likes
        Last Post Javierw.ok  
        Working...
        X