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

          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

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by fx.practic, 10-15-2013, 12:53 AM
              5 responses
              5,406 views
              0 likes
              Last Post Bidder
              by Bidder
               
              Started by Shai Samuel, 07-02-2022, 02:46 PM
              4 responses
              98 views
              0 likes
              Last Post Bidder
              by Bidder
               
              Started by DJ888, Yesterday, 10:57 PM
              0 responses
              8 views
              0 likes
              Last Post DJ888
              by DJ888
               
              Started by MacDad, 02-25-2024, 11:48 PM
              7 responses
              160 views
              0 likes
              Last Post loganjarosz123  
              Started by Belfortbucks, Yesterday, 09:29 PM
              0 responses
              9 views
              0 likes
              Last Post Belfortbucks  
              Working...
              X