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

Strategy using ZigZag

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

    Strategy using ZigZag

    hello,

    Using the strategy wizard, is it possible to buy (or sell at the top) next bar at market when the zig zag indicator shows the blue line down at the botton of the market? I was trying to get that logic work out using the wizard but I dont really know how.

    Anybody tried to code a strategy using the zig zag?

    Thanks for any help!

    Alan

    #2
    Hello futuros,

    Welcome to the NinjaTrader forums.

    Zig zag will return a numeric value and you can make comparisons with ZigZag to price data. Please see the help guide article below, on using the condition builder for indicator to value comparisons.


    On the right side of this comparison you could select instead price data.
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Thanks Ryan, If I put a deviation value 0f 3.0 do you have an idea what numeric value will result so Zig Zag will give a buy or sell signal?

      Thanks again,
      Alan

      Comment


        #4
        Not sure what value would result.

        You can Save a modified version of this indicator by right clicking > Save As and giving it a new name.

        You can then use Print() statement to see the values through the Tools > output window.


        Print(
        "High Series: " + zigZagHighSeries);
        Print(
        "Low Series: " + zigZagLowSeries);
        Ryan M.NinjaTrader Customer Service

        Comment


          #5
          OK Ryan, I got the new indicator ZigZagAlan, where do I put the Print() statement, inside the code? or in the output window?

          Comment


            #6
            Hi Ryan, I got it (put it in the indicator's code) but is giving me the value of the index (sp500) where the ZigZag is changing position (from long to short and viceversa) but is not giving me an indicator value, like the ADX above 20 for example, how do I fix that?

            Thanks,
            Alan

            Comment


              #7
              Hi Futuros,

              You're looking at the indicator value. It follows closely with price.
              Ryan M.NinjaTrader Customer Service

              Comment


                #8
                I am trying to use the zigzag indicator in a strategy with some other indicators and would like to detect when the zigzag is hit(or when the trend line is drawn or trend changes). How would I set it up in the strategy wizard using the indicator.
                ================================================== =========

                I have tried several different ways as suggested in these posts to detect a change in direction using the wizard to create a strategy to signal buy and sell points, Backtesting comes up with 0 trades. Any suggestion will help. I am not a programmer. Thanks!

                Stan.
                Attached Files

                Comment


                  #9
                  Hello,

                  I am jumping in here, but I will try to assist.

                  The zigzag redraws and is difficult to use programatically. It is meant only for visual observation. However to see how ZigZag changes dynamically, Print() the values you are using from it and see how they change in live market conditions. That may help.
                  DenNinjaTrader Customer Service

                  Comment


                    #10
                    Hello Ben,

                    Thanks for your response, I do realise and am aware that zigzag alone cannot be used for buy/sell strategies. Therefore I want to use zigzag as one of the indicators and would help as a confirmation for even a temporary change in direction.

                    I have used this strategy on an other platform successfully and am trying to port the concept and build it in Ninja Trader using the Wizard.

                    I would like to see the "trendDir" value and the High/Low Price on the Condition Builder so I can compare values.

                    Appreciate your guidance.

                    Stan.
                    Last edited by Stan01; 06-27-2010, 11:48 AM.

                    Comment


                      #11
                      Hello,

                      I am sorry, this would need to be programmed in custom as a plot. You only have the low and high available.
                      DenNinjaTrader Customer Service

                      Comment


                        #12
                        And how do you access the low and high that is available.

                        Comment


                          #13
                          Hello Stan01,

                          Attached is a screenshot showing how to select Zig Zag from the list of indicators in the condition builder. You can select either the ZigZagHigh or ZigZagLow plot.

                          See here for the help guide article on selecting individual plots through the condition builder.
                          Attached Files
                          Ryan M.NinjaTrader Customer Service

                          Comment


                            #14
                            Ryan,
                            Hello - I don't want to hijack someone's post. I didn't know where to post. I'm looking to store the last zigzag high and the last zigzag low as a variable. Then reference that point in a strategy. I'm having a problem finding anything that helps with how to get the point registered in the user variable I've created.

                            I created the user variable for zigzaghigh and zigzaglow. I guess the question is how to get the last zigzag high and low into the variable?
                            I am very new.
                            Thanks for your time.

                            Comment


                              #15
                              Hello laoshr,

                              Thanks for your first post!

                              In the NinjaTrader7 strategy wizard, you would actually need to use the predefined "user variables" listed as Variable0 through variable9. In the "do the following" of a set, you can select Misc>Set user defined variable, select the variable and for the "value" left click in the value row and left click on the ellipse button to then select Indicators>ZigZag and select which plot you want to save in that variable. If you do not place any conditions in the set then it will be executed on each bar, placing and updating the latest zigzag high or low. this then would let you use the variables as needed in your other sets.
                              Paul H.NinjaTrader Customer Service

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by DJ888, Today, 10:57 PM
                              0 responses
                              6 views
                              0 likes
                              Last Post DJ888
                              by DJ888
                               
                              Started by MacDad, 02-25-2024, 11:48 PM
                              7 responses
                              158 views
                              0 likes
                              Last Post loganjarosz123  
                              Started by Belfortbucks, Today, 09:29 PM
                              0 responses
                              7 views
                              0 likes
                              Last Post Belfortbucks  
                              Started by zstheorist, Today, 07:52 PM
                              0 responses
                              7 views
                              0 likes
                              Last Post zstheorist  
                              Started by pmachiraju, 11-01-2023, 04:46 AM
                              8 responses
                              151 views
                              0 likes
                              Last Post rehmans
                              by rehmans
                               
                              Working...
                              X