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 helpwanted, Today, 03:06 AM
    1 response
    10 views
    0 likes
    Last Post sarafuenonly123  
    Started by Brevo, Today, 01:45 AM
    0 responses
    9 views
    0 likes
    Last Post Brevo
    by Brevo
     
    Started by aussugardefender, Today, 01:07 AM
    0 responses
    5 views
    0 likes
    Last Post aussugardefender  
    Started by pvincent, 06-23-2022, 12:53 PM
    14 responses
    242 views
    0 likes
    Last Post Nyman
    by Nyman
     
    Started by TraderG23, 12-08-2023, 07:56 AM
    9 responses
    387 views
    1 like
    Last Post Gavini
    by Gavini
     
    Working...
    X