Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

No signal by Momentum definition

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

    No signal by Momentum definition

    Hallo,

    I have programmed the following code (is part of an indicator for signals for the MA):

    ...
    protected override void OnBarUpdate()
    {
    // Make sure there are enough bars.
    if (CurrentBar < 10)
    return;

    //ODR LONG:

    // Kurzfristige Trendausrichtung:
    if (EMA(10)[0] > EMA(10)[2]

    //Momentum Entwicklung:
    && Momentum(EMA(10), 10)[0] > 0
    && Momentum(EMA(10), 10)[0] > Momentum(EMA(10), 10)[2]


    //Langfristige Trendausrichtung:
    && EMA(8)[0] > EMA(10)[0]
    && EMA(10)[0] > EMA(20)[0]
    && EMA(20)[0] > EMA(50)[0]
    && EMA(20)[0] > SMA(200)[0]
    && EMA(50)[0] > SMA(200)[0]

    // 2. SwingHigh - Pattern - Definition LONG:
    && CrossAbove(Close, Swing(5).SwingHigh, 1))

    {
    Value.Set(1);
    }

    Problem: the indicator ignored the momentum code. Wehre ist the error?

    #2
    Blackburn,

    I am not seeing anything immediately obvious here. Could you describe what is happening here in a bit more detail?
    Adam P.NinjaTrader Customer Service

    Comment


      #3
      Hallo,

      please see the attach files. One of the points is, the the MOM must <0; on the pictures you see that isn't so. I got a signal (value 1) in the MA.

      would it be possible that it is up to the settings in MA?
      - # of bars look back: 256
      - calculate on bar close: false

      Blackburn
      Attached Files

      Comment


        #4
        MOM must be > 0

        Comment


          #5
          Hello,

          Thanks for that information.

          Specifically the session template between market analyzer and chart need to match and also the numbers of days back loaded for indicators need to also match.

          Please right click on the market analyzer and select properties.

          Its there you can get access to the session template.

          Finally: right click columns on the market analyzer. Set the indicator column to load the same amount of days/bars back that the chart is loading.

          -Brett
          BrettNinjaTrader Product Management

          Comment


            #6
            Hallo,
            do you mean the - # of bars look back?
            The # of bars look back in the properties of the MA and for the indicator must have the same value; is this right?
            Blackburn

            Comment


              #7
              Correct, this would need to be roughly the same amount of bars back you have in your chart for the same signal.

              -Brett
              BrettNinjaTrader Product Management

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by argusthome, 03-08-2026, 10:06 AM
              0 responses
              71 views
              0 likes
              Last Post argusthome  
              Started by NabilKhattabi, 03-06-2026, 11:18 AM
              0 responses
              42 views
              0 likes
              Last Post NabilKhattabi  
              Started by Deep42, 03-06-2026, 12:28 AM
              0 responses
              25 views
              0 likes
              Last Post Deep42
              by Deep42
               
              Started by TheRealMorford, 03-05-2026, 06:15 PM
              0 responses
              28 views
              0 likes
              Last Post TheRealMorford  
              Started by Mindset, 02-28-2026, 06:16 AM
              0 responses
              56 views
              0 likes
              Last Post Mindset
              by Mindset
               
              Working...
              X