NexusFi: Find Your Edge


Home Menu

 





Distance to moving average


Discussion in NinjaTrader

Updated
    1. trending_up 1,868 views
    2. thumb_up 3 thanks given
    3. group 2 followers
    1. forum 2 posts
    2. attach_file 1 attachments




 
Search this Thread
  #1 (permalink)
 calvin11 
madrid/spain
 
Experience: Beginner
Platform: ninjatrader
Trading: es
Posts: 5 since Nov 2011
Thanks Given: 6
Thanks Received: 1

Hi ... I wanted to create an indicator that measures the distance between the price and a moving average, in a percentage.Ninjatrader 8
Could someone help.
Thank you...


Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
SEC Chairman Calls for New Golden Age of SEC-CFTC Regula …
Traders Hideout
The May 31 Binary: 60% Trump Declares Iran Ops Over, Onl …
Prediction Markets & Event Contracts
GDP Day: The First Economic Reckoning -- Pahlavi at 6.55 …
Prediction Markets & Event Contracts
CME Raises Energy Futures Margins After Iran-War Volatil …
Commodities
CME Group Fee Schedule Changes Hit All Four Exchanges -- …
Traders Hideout
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Sober Journey With S&P
24 thanks
2026 Jlab journal
10 thanks
Algo automated / semi-automated trading anyone?
6 thanks
Lady Vols Primer: Trading Volatility Journal
6 thanks
Trying to learn Volume and price action correlation
5 thanks
  #2 (permalink)
 
WoodyFox's Avatar
 WoodyFox 
Columbus, Ohio
 
Experience: Intermediate
Platform: NinjaTrader
Trading: Futures
Posts: 417 since May 2016
Thanks Given: 205
Thanks Received: 890

Something Like this?


Attached Files
Elite Membership required to download: MAPriceDifference.cs
Reply With Quote
Thanked by:
  #3 (permalink)
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Market Wizard
 
Experience: Advanced
Platform: NinjaTrader
Broker: Interactive Brokers
Trading: Futures & Stocks
Posts: 9,887 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,114



calvin11 View Post
Hi ... I wanted to create an indicator that measures the distance between the price and a moving average, in a percentage.Ninjatrader 8
Could someone help.
Thank you...

Edit the MACD and save it under a different name. Then set the fast period of the MACD to 1. It now displays the distance between price and the slow EMA.
To display this distance as a percentage, divide it be the bar close and multiply it with 100.

In case that you wish to use another moving average, just replace the EMA with something else.


Reply With Quote
Thanked by:




Last Updated on June 9, 2020


© 2026 NexusFi®, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Downloads - Top
no new posts