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 mkaminski 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 4,149 views
    2. thumb_up 3 thanks given
    3. group 1 followers
    1. forum 10 posts
    2. attach_file 3 attachments




 
 

Help with Regularized EMA (RegEMA) code

 
 
mkaminski's Avatar
 mkaminski 
Colorado, US
 
Experience: Advanced
Platform: NinjaTrader
Broker: AMP, CQG
Trading: e-Mini S&P & Treasuries
Frequency: Daily
Duration: Minutes
Posts: 92 since Jun 2011
Thanks Given: 101
Thanks Received: 60

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

Can you help answer these questions
from other members on NexusFi?
MC PL editor upgrade
MultiCharts
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
What broker to use for trading palladium futures
Commodities
Trade idea based off three indicators.
Traders Hideout
Cheap historycal L1 data for stocks
Stocks and ETFs
 
 
 
cory's Avatar
 cory 
virginia
 
Experience: Intermediate
Platform: ninja
Trading: NQ
Posts: 6,098 since Jun 2009
Thanks Given: 877
Thanks Received: 8,090


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

Attached Files
Elite Membership required to download: RegEMA.cs
 
 
mkaminski's Avatar
 mkaminski 
Colorado, US
 
Experience: Advanced
Platform: NinjaTrader
Broker: AMP, CQG
Trading: e-Mini S&P & Treasuries
Frequency: Daily
Duration: Minutes
Posts: 92 since Jun 2011
Thanks Given: 101
Thanks Received: 60


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
 
 
cory's Avatar
 cory 
virginia
 
Experience: Intermediate
Platform: ninja
Trading: NQ
Posts: 6,098 since Jun 2009
Thanks Given: 877
Thanks Received: 8,090


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
Thanked by:
 
 
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,463 since Jun 2009
Thanks Given: 33,239
Thanks Received: 101,662

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 Twitter Visit my NexusFi Trade Journal
 
 
cory's Avatar
 cory 
virginia
 
Experience: Intermediate
Platform: ninja
Trading: NQ
Posts: 6,098 since Jun 2009
Thanks Given: 877
Thanks Received: 8,090


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.

 
 
mkaminski's Avatar
 mkaminski 
Colorado, US
 
Experience: Advanced
Platform: NinjaTrader
Broker: AMP, CQG
Trading: e-Mini S&P & Treasuries
Frequency: Daily
Duration: Minutes
Posts: 92 since Jun 2011
Thanks Given: 101
Thanks Received: 60


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
 
 
cory's Avatar
 cory 
virginia
 
Experience: Intermediate
Platform: ninja
Trading: NQ
Posts: 6,098 since Jun 2009
Thanks Given: 877
Thanks Received: 8,090

EMA vs RegEMA

Attached Thumbnails
Click image for larger version

Name:	6E 12-11 (4 Range)  10_17_2011.jpg
Views:	193
Size:	78.1 KB
ID:	52269  
 
 
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,463 since Jun 2009
Thanks Given: 33,239
Thanks Received: 101,662



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 Twitter Visit my NexusFi Trade Journal

 



Last Updated on October 17, 2011


© 2024 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 - Privacy Policy - Downloads - Top
no new posts