Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

EMA at crossover

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

    EMA at crossover

    Hello, I need my indicator to sound an alert when the volume bar exceeds the average volume ema. It would be important to know how you can interpret the indicator when a bar crosses or exceeds the ema. If you can help me if you are so kind? I attach a screenshot.
    Thank you.
    Attached Files

    #2
    Hello punkiy2111,

    Thank you for your post.

    You could use CrossAbove( ) in a custom indicator with the VOL() and EMA of the VOL to see if they've crossed on a specific bar:

    Code:
    if(CrossAbove(VOL(), EMA(VOL(),EMAPeriod), 1))
    {
    Alert("MyAlert", Priority.High, "VOL() crossed above EMA", NinjaTrader.Core.Globals.InstallDir+@"\sounds\Aler t1.wav", 1, Brushes.Transparent, Brushes.Yellow);
    }
    Please let us know if we may be of further assistance to you.
    Last edited by NinjaTrader_Kate; 10-08-2021, 10:51 AM.

    Comment


      #3
      Thanks Kate, just tell you that what I want is for the alert to sound when the volume bar crosses the average line (it looks good in the screenshot). Are you sure what is done with the CrossAbove command? Could you give me some more information please? I think it is a single line and it is thinking a lot about me ... you could not use the command
      if (Volume [0]> = VolEma) or something like that ...
      Thank you very much in advance.

      Comment


        #4
        Hello punkiy2111,

        Thank you for your reply.

        If you are running an indicator with the above code on each tick along with the two indicators you have applied in your screenshot, you'll need to replace EMAPeriod with the same period that the EMA in your screenshot is using, but yes, it would then go off once the VOL indicator for that bar crosses over the EMA line. I would not recommend just using if (Volume [0]> = VolEma) because the alert would be triggered every 1 second after the Volume is above your VolEMA. Using CrossAbove() with OnEachTick you'd only get the sound once during the bar, when the actual crossover occurs.

        Please let us know if we may be of further assistance to you.

        Comment


          #5

          if(CrossAbove(VOL(), EMA(VOL(),EMAPeriod), 1))
          Kate apologizes between the parentheses what do you wear? can it be left blank?

          Comment


            #6
            Hello punkiy2111,

            Thank you for your reply.

            The VOL() indicator does not need any parameters passed to it - it would simply use the primary series on the chart for its information. Parenthesis would hold parameters to pass to the indicator if required.

            I'm attaching a working example. If you apply this to your chart and set the EMAPeriod value to the same that you're using for the VOLMA, you should get an alert with sound when the bar crosses the EMA line.

            Please let us know if we may be of further assistance to you.
            Attached Files

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            571 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            330 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
            548 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            549 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X