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

EMA on Open Price of Bar?

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

    EMA on Open Price of Bar?

    Hi, How does one in Ninja Script declare that you would like to calculate the EMA on the Opening Price of the bar and not the close?

    For example, the line below will calculate for the Close of the Bar right?

    Add(EMA(5));

    What about if I wanted to use the Open Price of the Bar or H - L /2 ???

    Thanks

    David

    #2
    Hello,

    To calculate from the Open rather than the close, you would use Add(EMA(Open, 5));

    You could also use, High, Low, Median, Typical, etc.
    MatthewNinjaTrader Product Management

    Comment


      #3
      Thank you for the response.

      I am using Multi-TimeFrame and Instruments.

      Consider,

      Add(EMA(Open, 20));

      But I would like to use the EMA20 Open in a condition statement from my BarArrays[1] ??

      Consider the below condition statement using the EMA Close 20

      if (Closes[1][0] > EMA(BarsArrays[1], 20)[0])
      {
      //do something
      }

      How would I do the same above however with the EMA Open 20?

      Thanks again

      David

      Comment


        #4
        Hello David,

        In that case, you would use Opens:



        if (Closes[1][0] > EMA(Opens[1], 20)[0])
        MatthewNinjaTrader Product Management

        Comment


          #5
          Thank you Matthew, that makes absolute sense, don't know why I didn't see that!

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Karado58, 11-26-2012, 02:57 PM
          8 responses
          14,828 views
          0 likes
          Last Post Option Whisperer  
          Started by Option Whisperer, Today, 09:05 AM
          0 responses
          1 view
          0 likes
          Last Post Option Whisperer  
          Started by cre8able, Yesterday, 01:16 PM
          3 responses
          11 views
          0 likes
          Last Post cre8able  
          Started by Harry, 05-02-2018, 01:54 PM
          10 responses
          3,204 views
          0 likes
          Last Post tharton3  
          Started by ChartTourist, Today, 08:22 AM
          0 responses
          6 views
          0 likes
          Last Post ChartTourist  
          Working...
          X