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 jclose, Today, 09:37 PM
    0 responses
    5 views
    0 likes
    Last Post jclose
    by jclose
     
    Started by WeyldFalcon, 08-07-2020, 06:13 AM
    10 responses
    1,413 views
    0 likes
    Last Post Traderontheroad  
    Started by firefoxforum12, Today, 08:53 PM
    0 responses
    11 views
    0 likes
    Last Post firefoxforum12  
    Started by stafe, Today, 08:34 PM
    0 responses
    11 views
    0 likes
    Last Post stafe
    by stafe
     
    Started by sastrades, 01-31-2024, 10:19 PM
    11 responses
    169 views
    0 likes
    Last Post NinjaTrader_Manfred  
    Working...
    X