Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

EMA on the Indicator

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

    EMA on the Indicator

    I am creating a indicator and I need to check the possible trend. Is there any way for me to check if a specific bar is above or below a EMA ? Even better, a set of bars.

    #2
    Hello Sir I m a devlopper i can help you solve issue just explain to me more your idea and i will help you

    Comment


      #3
      Hello back to you sr. I am a software engineer, I am just looking for support from the creators of ninjascript, thank you Sir.

      If you want to "HELP" please answer here. this is a community; I have nothing against selling services. but be clear with your intentions. HELP implies, no cost.

      My question is very simple and straight forward, If you know ninjatrader framework you would quickly answer this
      Last edited by amfpaulo; 06-29-2024, 08:29 PM.

      Comment


        #4
        I m not seeling any services, i want just to help , your question not clear
        Thanks

        Comment


          #5
          Thank you. I need to know what the trend is based on a set of candles. Example. In a specific point (candle) I wanto look back X candles a tell if the trend was BULL, BEAR or TR
          Last edited by amfpaulo; 06-30-2024, 08:44 AM.

          Comment


            #6
            its not hard , you can make a loop with X bars lookback and you chack if above EMA(Period).

            Comment


              #7
              Please post a pseudo code/algo , also method from the framework I should use. Live CrossBelow/Above. You just made you something from thin air... Elaborate on your solution, if it was simple I was not going to be here asking this question. Can you add more details to your words?

              Comment


                #8
                I was thinking you are sofwtare enginner you can solve it easly

                Comment


                  #9
                  Man, It's not about Logic, I have the logic, Its about what the framework offers. Please do not waste people time. specially madding up stuff from thin air, I was being polite and open mind about the stupid think you wrote: "with X bars lookback and you check if above EMA(Period)"... DO NOT WASTE PEOPLE TIME. Let Ninja Trader support people answer. Do not try sell things you have no idea. Go try scam people someplace else.

                  Comment


                    #10
                    Check this link there is more information language and method of use of NinjaTrader Platform Trading Software on this : https://ninjatrader.com/support/help...rslookback.htm

                    Comment


                      #11
                      Hello amfpaulo,

                      I recommend you use the CountIf() method to return if the condition is true for specified number of bars.

                      For example:
                      private int barsBack = 5;
                      if (CountIf(() => Close[0] > SMA(14)[0], barsBack) > barsBack)
                      {
                      Print("the close was greater than the sma for the last " + barsBack + " bars");
                      }

                      Below is a link to the help guide.



                      You could also use a for loop (which is what the CountIf() method is doing internally).

                      For example:

                      private int barsBack = 5;

                      In OnBarUpdate():

                      bool allBarsGreater = true;

                      for (int index = 0; index < barsBack; index++)
                      {
                      if (Low[index] > SMA(14)[index])
                      {
                      allBarsGreater = false;
                      }
                      }

                      if (allBarsGreater == true)
                      {
                      Print("the close was greater than the sma for the last " + barsBack + " bars");
                      }

                      Below are links to educational material on for loops.
                      W3Schools offers free online tutorials, references and exercises in all the major languages of the web. Covering popular subjects like HTML, CSS, JavaScript, Python, SQL, Java, and many, many more.

                      Chelsea B.NinjaTrader Customer Service

                      Comment


                        #12
                        thank you Chelsea B. You guys always have precise answers.

                        Comment

                        Latest Posts

                        Collapse

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