NexusFi: Find Your Edge


Home Menu

 





Help with Regularized EMA (RegEMA) code


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one cory with 5 posts (3 thanks)
    2. looks_two MoreYuan53 with 3 posts (0 thanks)
    3. looks_3 Big Mike with 2 posts (0 thanks)
    4. looks_4 Quick Summary with 1 posts (0 thanks)
    1. trending_up 5,789 views
    2. thumb_up 3 thanks given
    3. group 1 followers
    1. forum 10 posts
    2. attach_file 3 attachments




 
Search this Thread
  #1 (permalink)
 
MoreYuan53's Avatar
 MoreYuan53 
 
Posts: 92 since Jun 2011

I was hoping someone in our community here could and would convert the following Easy Language code to NT7? It's for a regularized exponential moving average out of the July '03 S&C magazine.

The only additions to the code I would like is for the average to change colors when rising or falling and to be able to select various types of averages to include EMA, SMA, HMA & WMA.

Thank you in advance to anyone who takes this on.

RegEMA: Indicator

inputs:
EMA_Length(9),
Lambda(9);

variables:
RegEMA(0),
Alpha( 2 / ( EMA_Length + 1 ) ) ;

if CurrentBar > 3 then
RegEMA = (RegEMA[1]*(1+2*Lambda) + Alpha*(C-RegEMA[1])-Lambda * RegEMA[2])/(1+lambda)

else

RegEMA = Close ;
Plot1( RegEMA, "RegEMA") ;


Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
SEC Advisory Committee Backs Tokenized Securities Exempt …
Traders Hideout
TradingView Opens Volume Footprint Data to Pine Script - …
TradingView
Third Circuit Backs Kalshi in Landmark Ruling -- Predict …
Prediction Markets & Event Contracts
$24.5 Billion Record Month: Prediction Markets Shatter A …
Prediction Markets & Event Contracts
White House Drops First Alien Files Today -- Market Says …
Prediction Markets & Event Contracts
 
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
  #3 (permalink)
 
cory's Avatar
 cory 
virginia
the coin hunter
 
Experience: Intermediate
Platform: ninja
Trading: NQ
Posts: 6,098 since Jun 2009
Thanks Given: 877
Thanks Received: 8,093


not sure if I do it right it looks pretty much like EMA


Attached Files
Elite Membership required to download: RegEMA.cs
Reply With Quote
  #4 (permalink)
 
MoreYuan53's Avatar
 MoreYuan53 
 
Posts: 92 since Jun 2011


cory View Post
not sure if I do it right it looks pretty much like EMA

Hi Cory.

Thank you for your time spent on this. Something does seem off but not being a programmer, I cannot help much.

Typically, if the lambda is set to 0 then it will be exactly like the standard EMA. However, the higher the lambda, the more regularized or smoothed the average becomes.


Started this thread Reply With Quote
  #5 (permalink)
 
cory's Avatar
 cory 
virginia
the coin hunter
 
Experience: Intermediate
Platform: ninja
Trading: NQ
Posts: 6,098 since Jun 2009
Thanks Given: 877
Thanks Received: 8,093


mkaminski View Post
Hi Cory.

Thank you for your time spent on this. Something does seem off but not being a programmer, I cannot help much.

Typically, if the lambda is set to 0 then it will be exactly like the standard EMA. However, the higher the lambda, the more regularized or smoothed the average becomes.

ok , not a bad looking MA, see if it works correctly


Attached Files
Elite Membership required to download: RegEMA.cs
Reply With Quote
Thanked by:
  #6 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,669 since Jun 2009
Thanks Given: 33,669
Thanks Received: 102,557

Similar to Holt EMA?





Mike




We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on X Visit my NexusFi Trade Journal Reply With Quote
  #7 (permalink)
 
cory's Avatar
 cory 
virginia
the coin hunter
 
Experience: Intermediate
Platform: ninja
Trading: NQ
Posts: 6,098 since Jun 2009
Thanks Given: 877
Thanks Received: 8,093


Big Mike View Post
Similar to Holt EMA?





Mike

calculation equation of regEMA is a little bit longer than Holt. And yes I cannibalized holt to make regEMA.


Reply With Quote
  #8 (permalink)
 
MoreYuan53's Avatar
 MoreYuan53 
 
Posts: 92 since Jun 2011


cory View Post
ok , not a bad looking MA, see if it works correctly

You're the MAN! Works perfectly.

Thank you once again for your time and efforts.


Started this thread Reply With Quote
  #9 (permalink)
 
cory's Avatar
 cory 
virginia
the coin hunter
 
Experience: Intermediate
Platform: ninja
Trading: NQ
Posts: 6,098 since Jun 2009
Thanks Given: 877
Thanks Received: 8,093

EMA vs RegEMA


Attached Thumbnails
Click image for larger version

Name:	6E 12-11 (4 Range)  10_17_2011.jpg
Views:	244
Size:	78.1 KB
ID:	52269  
Reply With Quote
  #10 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,669 since Jun 2009
Thanks Given: 33,669
Thanks Received: 102,557



cory View Post
EMA vs RegEMA

Looks quite similar to a 'DoubleMA' EMA.

Mike




We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on X Visit my NexusFi Trade Journal Reply With Quote




Last Updated on October 17, 2011


© 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