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




 
Search this Thread

Help with Regularized EMA (RegEMA) code

  #1 (permalink)
 
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 Reply With Quote

Can you help answer these questions
from other members on NexusFi?
REcommedations for programming help
Sierra Chart
ZombieSqueeze
Platforms and Indicators
Quantum physics & Trading dynamics
The Elite Circle
MC PL editor upgrade
MultiCharts
Cheap historycal L1 data for stocks
Stocks and ETFs
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Just another trading journal: PA, Wyckoff & Trends
22 thanks
What is Markets Chat (markets.chat) real-time trading ro …
19 thanks
ApexTraderFunding.com experience and review
15 thanks
GFIs1 1 DAX trade per day journal
15 thanks
EG Indicators
11 thanks
  #3 (permalink)
 
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
Reply With Quote
  #4 (permalink)
 
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 Reply With Quote
  #5 (permalink)
 
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
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,471 since Jun 2009
Thanks Given: 33,250
Thanks Received: 101,674

Similar to Holt EMA?





Mike



Join the free Markets Chat beta: one platform, all the trade rooms!

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 Reply With Quote
  #7 (permalink)
 
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.

Reply With Quote
  #8 (permalink)
 
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 Reply With Quote
  #9 (permalink)
 
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  
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,471 since Jun 2009
Thanks Given: 33,250
Thanks Received: 101,674



cory View Post
EMA vs RegEMA

Looks quite similar to a 'DoubleMA' EMA.

Mike



Join the free Markets Chat beta: one platform, all the trade rooms!

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 Reply With Quote




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