Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Zero Lag MACD - programming hint

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

    #16
    Here is the LeaderOfMACD indicator. Do you have any insight on its intended use? If so I can include it in the description and post it in the file sharing section. It looks extremely useful!

    As for the ZeroLagMACD, there were errors in the code you provided. It says "The name 'macdAvg2' does not exist in the current context". This error appears 4 times and I was unable to resolve it. Any ideas?
    Attached Files

    Comment


      #17
      Sorry, I think I forgot this: under variables add "private DataSeries macdAvg2;". Let me know if it works.

      Comment


        #18
        That did the trick!

        This is so much better than the regular MACD. I never use the default values, but rather use a higher slow period and a gigantic smooth value to avoid wipsaws, and this really cuts down on the lag.

        If I get a chance later today, I think I'll play around with the code a little more and add the ability to use different MA types...

        Now I'm curious what a 'ZeroLagLeaderOfMACD' would look like.

        I can't wait for NT7 when the InputSeries parameter is available outside of the strategy wizard, 'cause its a real pain having to recode every indicator I want to use smoothed data with...

        Anyway, I hope people find this useful. I'll write a description and add it to the file sharing section later today...
        Attached Files

        Comment


          #19
          Good. For the ZeroLag just replace all EMAs in the code with ZeroLagEMA. It's real simple. Look here http://www.traders.com/S&C_homepg.html next month to see what they say. As said, it's not out yet but a couple of programs already have this indicator so I thought I'd see what it does and/or if it is useful.

          For the JMA here are 2 pictures just to give you an idea: they are all 50 MA: blue solid = EMA; blue dash = SMA; orange = ZeroLagEMA; red =JMA with phase +100 and green = JMA ith phase -100 (these are the 2 extremes but you can put in any number from -100 to +100.

          For the other picture I put in various DM which have been smoothed using T3 and zeroLagEMA (since you said you tried this) the Jurik DMX, a DM smoothed with a JMA and finally the DM. For the DMX I removed the DM+/DM- which are represented here by the DMX line which oscillates around the 0. Although the DM and DMX is a nice indicator, it becomes dangerous when you get a bad tick => see on the chart the 28th at about 20:55. See that huge uptick ? I think that's probaby a bad tick and see how the DM and the DMX immediately jump up. It might be an idea to try and smooth the DMX as well, which would probably remove this. To me, if you were to try and built an automatic system this would disqualify this indicator.....
          Attached Files

          Comment


            #20
            Thanks for the screenshots. The JMA looks considerably better than the other average types.

            Judging by the DM screenshots, the ZeroLagEMA version seems about as quick as the Jurik and the T3 looks about as smooth. I think I might try a ZeroLagEMA DM using a T3 with a smooth of 2-3 as the input. I think it would be really close. I still plan to get the Jurik indicators, but would like to be able to get as close as possible with open source indicators first.

            Also, I made a ZeroLagLeaderOfMACD and found it useful although it benefits greatly from presmoothing the data a bit...

            Comment


              #21
              A quick point to a Tilson MA would be appreciated, since I can't seem to find any.
              eDanny
              NinjaTrader Ecosystem Vendor - Integrity Traders

              Comment


                #22
                luckyphil -- here's the ZeroLagMACD with the tick-up/tick-down histogram painted green/red for you.

                cheers,
                -e

                EDIT: removed attachment; revised version in next post.
                Last edited by e-man; 05-11-2009, 08:44 AM.

                Comment


                  #23
                  here's the revised version that colors the macd-avg line red/green or leaves it blank based on rise/fall.

                  cheers,
                  -e
                  Attached Files

                  Comment


                    #24
                    Hello,

                    I have a problem with the zerolagMACD of different type,
                    as you can see in the picture (Zerolag MACD.jpg) i send with this post.

                    So when i choose "calculate on bar close" to "false", the zero lag macd
                    indicators are going to zero .

                    Maybesomeone can again help me .
                    Thanks
                    Attached Files

                    Comment


                      #25
                      Primoto - did you spot any error messages in the Log tab of the Control Center?
                      BertrandNinjaTrader Customer Service

                      Comment


                        #26
                        Hi Bertrand

                        Here is an image of the log , i've the same problem with those 2 indicators than with the zerolag macd of mike, in calculate bar close false , the indicators stay in zero.
                        I've read your post in other file i will check in the code.
                        Thanks anyway
                        Attached Files

                        Comment


                          #27
                          This is a known bug in NT that arises when one indicator uses another and they have conflicting settings for CalcOnBarClose in their Initialize() methods.

                          The solution is to edit all your .cs files and remove the CalcOnBarClose lines from Initialize()

                          (or set all indicators to CalcOnBarClose = false, which is what I have done)

                          Comment


                            #28
                            Originally posted by sefstrat View Post
                            (or set all indicators to CalcOnBarClose = false, which is what I have done)
                            I had the same problem and could it fix this way:

                            Edit the ZeroLag-EMA and set on Line 34 the CalculateOnBarClose from true to false .

                            Then compile and save and hope that it works .

                            Comment


                              #29
                              Yes I think we all agree that was the issue and the fix. Glad to learn of this, it was bugging me on some other stuff that uses the ZLEMA.

                              When I release an updated version of MACD ZeroLag I will include the new zerolagema with that fix in it.

                              Mike

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by Barry Milan, Today, 10:35 PM
                              1 response
                              7 views
                              0 likes
                              Last Post NinjaTrader_Manfred  
                              Started by WeyldFalcon, 12-10-2020, 06:48 PM
                              14 responses
                              1,428 views
                              0 likes
                              Last Post Handclap0241  
                              Started by DJ888, Yesterday, 06:09 PM
                              2 responses
                              9 views
                              0 likes
                              Last Post DJ888
                              by DJ888
                               
                              Started by jeronymite, 04-12-2024, 04:26 PM
                              3 responses
                              40 views
                              0 likes
                              Last Post jeronymite  
                              Started by bill2023, Today, 08:51 AM
                              2 responses
                              16 views
                              0 likes
                              Last Post bill2023  
                              Working...
                              X