NexusFi: Find Your Edge


Home Menu

 





Distance to moving average


Discussion in NinjaTrader

Updated
    1. trending_up 2,125 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?
AI for Traders — Agents, Memory, Tools & Real-Worl …
Elite Quantitative GenAI/LLM
Bitcoin’s 2022 low, 2025 high and 2026 low so far arou …
Cryptocurrency
requesting .nrd replay files from 2026 spy and qqq
The Elite Circle
[WTS] ATAS Lifetime ULTRA license – EU buyers only – …
Platforms and Indicators
Building a free browser DOM/SMC simulator - need some ad …
Platforms and Indicators
 
  #2 (permalink)
 
WoodyFox's Avatar
 WoodyFox 
Columbus, Ohio
 
Experience: Intermediate
Platform: NinjaTrader
Trading: Futures
Posts: 417 since May 2016
Thanks Given: 207
Thanks Received: 891

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
Legendary 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,117



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