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

Bill Williams Strategy.

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

    Bill Williams Strategy.

    Hey Everyone,

    I want to build a strategy that uses Bill Williams' Alligator indicator as the source for signals. I tried to get it to do the following:

    If Lips crosses above Jaw: Up arrow.
    If Lips crosses above Teeth: Up triangle.
    If Jaw crosses below Lips: Down arrow.
    If Teeth crosses below Lips: Down triangle.

    I am using the Zero-Lag Moving Average. I could just chart read but the strategy would be useful in seeing if I read what the strategy does.

    Any help would be appreciated. This is my first strategy and I want to learn as much as I can.
    Last edited by Drakmyre; 08-21-2008, 10:32 PM.

    #2
    If the community would not contribute, then you could contact a certified NinjaScript consultant as last resort.

    Comment


      #3
      In the file sharing section I already posted a version of the Alligator indicator you can use. No guarantees on indicator accuracy though. Was never fully tested.
      Josh P.NinjaTrader Customer Service

      Comment


        #4
        Josh,

        I downloaded the indicator. I just want to know if anyone can develop a strategy that generates the arrows and triangles when the different crossovers happen.

        Comment


          #5
          Hey Dierk,

          How can I move the arrows to the right MA Crossing points? They always seem to stack on top of each other.

          Comment


            #6
            Make sure each DrawTriangle() has a unique string name associated with it. A common technique to do this is to do "Triangle" + CurrentBar for its name
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              Josh,

              Here is the code. It has the "DrawTriangle" + Current Bar but the same thing happens.


              // Condition set 1
              if (CrossAbove(ZeroLagEMA(Lips).ZLEMA, ZeroLagEMA(Teeth).ZLEMA, 1))
              {
              DrawArrowUp("My up arrow" + CurrentBar, false, (int) (Close[0]), Close[0], Color.Lime);
              }

              // Condition set 2
              if (CrossAbove(ZeroLagEMA(Lips).ZLEMA, ZeroLagEMA(Jaw).ZLEMA, 1))
              {
              DrawTriangleUp("My triangle up" + CurrentBar, false, (int) (Close[0]), Close[0], Color.Lime);
              }

              // Condition set 3
              if (CrossBelow(ZeroLagEMA(Jaw).ZLEMA, ZeroLagEMA(Lips).ZLEMA, 1))
              {
              DrawArrowDown("My down arrow" + CurrentBar, false, (int) (Close[0]), Close[0], Color.Red);
              }

              // Condition set 4
              if (ZeroLagEMA(Teeth).ZLEMA[0] + 5 * TickSize == ZeroLagEMA(Lips).ZLEMA[0] + 2 * TickSize)
              {
              DrawTriangleDown("My triangle down" + CurrentBar, false, (int) (Close[0]), Close[0], Color.Red);
              }
              }

              Comment


                #8
                You will need to debug it as per this tip: http://www.ninjatrader-support.com/v...ead.php?t=3418

                Check values on every step and variable. See what you are actually plotting as opposed to what you think the code is suppose to plot.
                Josh P.NinjaTrader Customer Service

                Comment


                  #9
                  Update.

                  Josh,

                  I get arrows and triangles(mostly arrows) appearing multiple times on the same graph when they should be there once. Down triangles don't appear at all. Any idea what to do?
                  Last edited by Drakmyre; 08-21-2008, 10:32 PM.

                  Comment


                    #10
                    Drakmyre,

                    Unfortunately due to bandwidth reasons we cannot debug every indicator/strategy on a case by case basis for every customer. You will just need to get down into the code and inspect it with Print() everywhere and such to find out exactly what is happening.

                    Areas to pay attention to would be any if statements you have. Print before the ifs, inside the ifs, and immediately outside the ifs. This will let you determine if you are entering the if logic properly. Print every value for every variable out. Run your logic with pen and paper and try to match it with what you are seeing on screen.
                    Josh P.NinjaTrader Customer Service

                    Comment


                      #11
                      Josh,

                      Thanks for the help! I just put it up there so if anyone wanted to take a look at it they could just download what I have worked on so far.

                      Comment


                        #12
                        hi Drakmyre,

                        where do i find to download what you have worked out ?

                        Thanks
                        max-td

                        Comment


                          #13
                          File.

                          Hey Max,

                          I dumped the idea and worked on just applying the Alligator already supplied on the site. It's a bit less volatile but follows the ZEMA lines very closely. From there I just wizard it.

                          I've done some other systems and am currently tuning them.

                          Comment


                            #14
                            OK np - i was interested in the way you created this stuff with formulas, arrows and so on ..... cause i am working on learning how to code at the moment and catch up every interesting sample + example i find

                            max-td

                            Comment

                            Latest Posts

                            Collapse

                            Topics Statistics Last Post
                            Started by Quanto, 04-17-2024, 10:43 AM
                            2 responses
                            18 views
                            0 likes
                            Last Post Quanto
                            by Quanto
                             
                            Started by Irukandji, Today, 03:06 PM
                            0 responses
                            4 views
                            0 likes
                            Last Post Irukandji  
                            Started by cmtjoancolmenero, 04-25-2024, 03:58 PM
                            17 responses
                            89 views
                            0 likes
                            Last Post cmtjoancolmenero  
                            Started by nleitman, Today, 11:46 AM
                            8 responses
                            20 views
                            0 likes
                            Last Post nleitman  
                            Started by Option Whisperer, 03-20-2024, 07:01 AM
                            3 responses
                            69 views
                            0 likes
                            Last Post ScalpRule  
                            Working...
                            X