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

LineAlert indicator use

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

    LineAlert indicator use

    Hi Ninjas

    I am trying to start using a LineAlert indicator, but haven't seen any alert yet.
    As was suggested by its creator RyanM:
    1. I open a chart
    2. add the indicator
    3. draw a manual line across the last bar.

    I don't get any alerts whatsoever. File/New/Alerts is blank as well.

    I use EOD Stocks data from Kinetick.
    I attach the indicator properties screenshot.
    Am I supposed to go to the indicator code and tweak something there?
    I can see people are using it, please help me to become one of them
    Attached Files
    Last edited by ionaz; 06-24-2013, 05:14 AM.

    #2
    Hello ionaz,

    Thank you for your post.

    There is no need to alter the code. The item here is using an End Of Day Data Feed, this data feed is only updated once per day. This means the CrossAbove() and CrossBelow() conditions for the LineAlert will only be checked on that one update if you have the chart open and connected at that time.

    This indicator will update when price actively crosses above or below the manually drawn line, not historically.

    Comment


      #3
      Hi Patrick

      Thanks for your post.

      Is there a way I can ask this indicator to become sensitive to a historic last bar??

      If not, can you pls suggest another indicator for this purpose or some NT methods that could be a good start if I was to develop this myself.

      I am trying to do:
      1) draw an automatic trendline over the two swings on a MACD avg line (done)
      2) want to get some sort of alert (best would be 1 / 0 in the market analyzer) when this trendline is crossed by the same MACD line

      Don't want to reinvent the wheel obviously, but if there're no such indicators developed, then maybe there are some powerful NT methods?

      Comment


        #4
        Hello ionaz,

        Thank you for your response.

        You could add a check such as the following:
        Code:
        if(MACD(12, 26, 9)[1] > myTrendLine)
        {
        ///your alert
        }
        The code above would check one bar back for the MACD being greater than the trend line.

        Comment


          #5
          Thanks so much Patrick!

          This is great, I will definitely use this.

          Jonas

          Comment


            #6
            if(MACD(12, 26, 9)[1] > myTrendLine) { ///your alert }
            Hi Patrick

            I can't compile this one. I'm sure this is because of "myTrendline" bit.
            How should I dim the myTrendline so that I could compile?

            Currently what I have is:
            Code:
            protected override void OnBarUpdate()
            //MACD swings defined
            
            //Trendline which connects the swings
            DrawTrendChannel("[B]myTrendline[/B]", true, prevMacdHighBar2, prevMacdHigh2, prevMacdHighBar, prevMacdHigh,prevMacdHighBar, prevMacdHigh);
            So visually it appears as a trendline on the MACD panel. As you can see, it has a tag "myTrendline", but this is not enough when I attempt to compile the following as per your suggestion:

            Code:
            if(MACD(12, 26, 9)[1] > myTrendLine) { ///your alert }
            CS0103 is the error code I get.

            Please advise

            Comment


              #7
              Hello ionaz,

              Thank you for your response.

              'myTrendLine' was a place holder used in my example to detail whatever the value of your TrendChannel would be on the last bar or previous bar.

              I recommend reviewing the LineAlert code to see exactly how these crosses are handled. Look at the lineValueAtLastBar variable used in the LineALert and see how it is used to pull the value of a line on the last bar to be used in a CrossAbove or Below condition. This will help you in using this with your own custom code for DrawTrendChannel and the previous bar.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by rocketman7, Today, 01:00 AM
              0 responses
              1 view
              0 likes
              Last Post rocketman7  
              Started by wzgy0920, 04-20-2024, 06:09 PM
              2 responses
              27 views
              0 likes
              Last Post wzgy0920  
              Started by wzgy0920, 02-22-2024, 01:11 AM
              5 responses
              32 views
              0 likes
              Last Post wzgy0920  
              Started by wzgy0920, 04-23-2024, 09:53 PM
              2 responses
              74 views
              0 likes
              Last Post wzgy0920  
              Started by Kensonprib, 04-28-2021, 10:11 AM
              5 responses
              193 views
              0 likes
              Last Post Hasadafa  
              Working...
              X