NexusFi: Find Your Edge


Home Menu

 





NinjaScript equivalent of EasyLanguage's volatility function?


Discussion in NinjaTrader

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




 
Search this Thread
  #1 (permalink)
 zwentz 
Austin, TX
 
Experience: Advanced
Platform: NinjaTrader
Broker: Optimus Futures/Rithmic
Trading: Futures [ZB]
Posts: 36 since Sep 2009
Thanks Given: 12
Thanks Received: 22

I'm having difficulty finding an equivalent of EasyLanguage's Volatility function. For reference here is EasyLanguage's definition of "Volatility."


Quoting 
Volatility (Function)

Disclaimer

The Volatility series function measures the market volatility by plotting a smoothed average of the TrueRange. It
returns an average of the TrueRange over a specific number of bars, giving higher weight to the TrueRange of the
most recent bar.

Syntax
Volatility(Length)
Returns (Double)

A numeric value containing the market volatility. As the number increases, the market is more volatile.

Description
Volatility is the variation in price over a specific interval (the difference between the highest and lowest prices). As the
time interval being studied increases, volatility also increases to a maximum before leveling off. As prices increase, the
volatility tolerance also increases.

Note The Volatility function uses a slightly different set of calculations than the original formula. The Volatility
variation tends to smooth recent activity, which means that it will take more time (bars) to ‘normalize.’

I've tried Ninja's RVI, ATR, and StdDev methods, none of which give comparable results.

Has anyone has success with this before?

Thanks.


Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Penalties in Budapest, Peace Deadline in Tehran: Arsenal …
Prediction Markets & Event Contracts
OneChronos Launches First Combinatorial Auction FX Venue …
Currencies
The May 31 Binary: 60% Trump Declares Iran Ops Over, Onl …
Prediction Markets & Event Contracts
CME Cuts Precious Metals Margins Up to 21% Starting Toda …
Commodities
The Feds Stagflation Trap -- Negative Payrolls, $91 Oil, …
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
2026 Fire Horse
5 thanks
  #3 (permalink)
 zwentz 
Austin, TX
 
Experience: Advanced
Platform: NinjaTrader
Broker: Optimus Futures/Rithmic
Trading: Futures [ZB]
Posts: 36 since Sep 2009
Thanks Given: 12
Thanks Received: 22


Solved it.

Let's say you want Volatility(6).

You would do this in Ninjatrader to get the equivalent: SMA(ATR(3),6)[0]

Basically you take the SMA of ATR with half your period.

It's not exact, but it's damn close.


Started this thread Reply With Quote
Thanked by:
  #4 (permalink)
 fluxsmith 
Santa Maria
 
Experience: Advanced
Platform: NinjaTrader, ThinkOrSwim
Broker: Mirus/Zen-Fire
Trading: ES
Posts: 290 since May 2010
Thanks Given: 97
Thanks Received: 323

Since their description says "giving higher weight to the TrueRange of the most recent bar" they are probably not using an SMA, maybe an EMA?


Visit my NexusFi Trade Journal Reply With Quote




Last Updated on May 29, 2010


© 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