Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Getting price from current EMA

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

    Getting price from current EMA

    I need to get the market price where the current EMA is at. For example if i set the period to 15.

    double value= EMA(period)[0];

    How can i get the current market value where the EMA(15)[0] is at?

    #2
    Hello majanua,

    Are you looking for the difference between the EMA value and the last price? This is expressed with:

    double EMADiff = Close[0] - EMA(15)[0];


    If you want to capture EMA value, you had it correct with:
    double value= EMA(period)[0];


    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      I want to get the current market price at EMA value

      Comment


        #4
        Sorry, I don't follow what you're looking for. Can you please clarify?
        Ryan M.NinjaTrader Customer Service

        Comment


          #5
          For example if the current market price is at 9768 and emas are below 9768 by 10 pips thus ema have current price at 9758. How can i find the current price where ema is at? meaning based on my code i want to get 9758 back(which is price ema is at.)

          Comment


            #6
            You had it in your first post.

            double value= EMA(period)[0];


            That's the price that the ema is at.
            Ryan M.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by CarlTrading, 03-31-2026, 09:41 PM
            1 response
            134 views
            1 like
            Last Post NinjaTrader_ChelseaB  
            Started by CarlTrading, 04-01-2026, 02:41 AM
            0 responses
            75 views
            1 like
            Last Post CarlTrading  
            Started by CaptainJack, 03-31-2026, 11:44 PM
            0 responses
            119 views
            2 likes
            Last Post CaptainJack  
            Started by CarlTrading, 03-30-2026, 11:51 AM
            0 responses
            114 views
            1 like
            Last Post CarlTrading  
            Started by CarlTrading, 03-30-2026, 11:48 AM
            0 responses
            90 views
            0 likes
            Last Post CarlTrading  
            Working...
            X