Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Centered Moving Average for everyone

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Centered Moving Average for everyone

    Hello ninjas,

    Having read several Hurst Cycles Analysis books, seminars, and fellow NT members' posts / ninjascripts regarding Hurst Cycle, I would like to share my CMA (Centered Moving Average) indicator here. Although I have looked at the ninjascripts of TMA, T3 and TEMA, I am not using their codes because I aim to minimize the shift (lag) and future projection (repaint) as much as possible. Anyways, the envelopes are useful, and I will add more features as time goes.

    In this example, I have a EUR/USD daily chart with a Centered Moving Average indicator with its upper and lower envelopes (please see the attachment.) Although I coded the CMA indicator in mql4 language (for MT4 and MT5), I have recently translated it into ninjascript after reading all 1027 pages of the NinjaTrader Help Guide. The CMA nanjascript is complied successfully, but somehow it is not showing on the chart. I wonder whether you may lend me a hand so that once my ninjascript is fixed, I can expand the CMA with more features and share with everyone. Thanks a lot in advance!

    My source code from mql4 language (which is a C language):

    ################################################## ########################

    ################################################## #######################

    Attached, you will find the EUR/USD daily chart (I copied it from my MT4 platform).


    Now, the following is my ninjascript that somehow does not plot anything on the chart:
    ################################################## #######################

    ################################################## ######################

    Thanks in advance for the help!



    Updated: Problem fixed after many, many sleepless days and nights of extensive testing on my own, but I would like to thank Bertrand for the quick response and help. I will post again after I make sure my complete set of Hurst Cycle ninjascript works, instead of asking people to fix it.
    Last edited by Trader100; 09-18-2013, 11:39 AM.

    #2
    Welcome to our forums and thanks for looking to contribute here - do you get any errors in your log tab? I would suspect it since a check for enough current bar in your OnBarUpdate() part is missing -

    BertrandNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by inanazsocial, Today, 01:15 AM
    1 response
    5 views
    0 likes
    Last Post NinjaTrader_Jason  
    Started by rocketman7, Today, 02:12 AM
    0 responses
    10 views
    0 likes
    Last Post rocketman7  
    Started by dustydbayer, Today, 01:59 AM
    0 responses
    1 view
    0 likes
    Last Post dustydbayer  
    Started by trilliantrader, 04-18-2024, 08:16 AM
    5 responses
    23 views
    0 likes
    Last Post trilliantrader  
    Started by Davidtowleii, Today, 12:15 AM
    0 responses
    3 views
    0 likes
    Last Post Davidtowleii  
    Working...
    X