Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to refer back the candle in set 1 of Strategy Wizard?

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

    How to refer back the candle in set 1 of Strategy Wizard?

    I want to know how I can refer back to the candle that I create in set 1 of the Strategy Wizard. In the condition builder of the Strategy Wizard there are set 1 to set 10, and in each set one can create a condition to find a specific type of candle. After I create such a candle in set 1, how can I base set 2 conditions on this set 1 candle? For example if I specify that a dot be placed in set 1 candle how can I then specify that the next candle after this candle in set 1 should get an up arrow.
    Last edited by bijan; 03-22-2012, 05:58 PM.

    #2
    bijan, per default the different Set's would be working indpendent from each other, however with user variables you can 'link' them together, so you can set a value for example in Set1 and then check for this value to be set in your next Set - we have a sample showing this technique here -

    BertrandNinjaTrader Customer Service

    Comment


      #3
      I was writing another post to explain what I want done but it seems I managed to create it to some extent. So I will try again and hopefully I can do what I want this time. Thank you for your help.

      Comment


        #4
        I spoke too soon. I did managed to create a link between set 1 and set 2 but when I tried to create a similar link between set 2 and set 3 I was not successful. Can you show me the way? I will write a more detailed reply after I come back if I have not heard from you. Thank you.

        Comment


          #5
          bijan,

          You may be able to use UserVariables for this. With the complexity required though, you may also want to dig into the code and work with MRO(), for example. This is a built in method that returns the number of bars since a condition, which it seems is what you're looking to get. You can see example usage of MRO here:

          Ryan M.NinjaTrader Customer Service

          Comment


            #6
            Thank you for the MRO() link. I looked at it but need time to see if I can understand and use it.

            I had a few questions about linking sets in the Strategy Wizard. Can sets be linked in sequence only, like linking set 1 to set 2 and link set 2 to set 3 etc. Or can they also be linked out of sequence, like linking set 1 to set 3 and set 3 to set 5 etc.?

            I seem to be able to link set 1 to set 2 by putting in "Do the following" of set 1 a last line of Variable0=0, and then in "When the following conditions are true" of set 2 a first line of Variable0==Variable1, also in the "Do the following" of set two I put the first line of Variable0=1. This seems to link set 1 and set 2 so that set 2 value starts from set 1 value. But when I try to link set 2 to set 3 by changing the zeros to 1 and ones to 2 as outlined above this does not seem to link the set 2 to set 3. Can you show me how to link set 2 to set 3 after I have linked set 2 to set 1? Thank you.

            Comment


              #7
              bijan, the different sets act independently together, you can 'link' 1 to 2 or 3 to 7, it would just depend on the correct user variable logic applied and also when you would reset them, as for example the value you assign to a variable will stay unless you assign it new / differently, which also is called the reset. If you can attach your created script here or send to us at support at ninjatrader dot com we would be glad to take a look.
              BertrandNinjaTrader Customer Service

              Comment


                #8
                I will send you the script at a later time. But right now I want to have an example of how set 2 can be linked to set 3, after set 2 has been linked to set 1. From what you wrote I gather that after set 1 and 2 are linked this link can not remain if set 2 is linked to set 3, in other words link 1 and 2 have to be reset or the link has to be removed before set 2 and 3 can be linked. Am I correct? Basically what I want to know is how can I link set 1 to set 2 so that a candle that is found in set 1 then be used as the reference candle in set 2. After this is done, then I want the candle found in set 2 to become the reference candle for set 3. I hope this is clear enough for you. Let me try to give you an example that might be helpful to understand what I want to be able to accomplish. Let's say in set 1 I find a candle that is at the moment when 2 EMAs cross. I then want to use this candle as a reference and say from this candle onward look for another candle with such and such characteristics. Once this second candle is found I then want to it to look for a third condition past this candle such as a volume that is twice the average of the past 20 candles. I can accomplish the first 2 parts of such a strategy, namely finding the candle at the EMAs cross, and finding a second candle past the candle at the EMAs cross with certain characteristics by linking the set 1 to set 2. But when I try to introduce the third requirement by linking set 2 to set 3 the program does not seem to respond. I hope this example makes my question obvious. Again my question is how do I link set 2 to set 3, after set 2 has been linked to set 1 already. I like you to spell it out for me if you don't mind, by saying this is how you de-link (reset) set 1 and set 2 and this is how you link set 2 to set 3. Thanks.

                Comment


                  #9
                  bijan, to clarify - the link is introduced by setting a variable to a certain value - if you would like to setup 2 links so to speak then use another user variable here, that you would only set if your first 2 conditions have been hit (meaning the sequential candle characteristics you seek have been found). What do you mean by please that the program would not respond? Would you code cause a non responding state for NT itself or would it not evaluate as you seek?
                  BertrandNinjaTrader Customer Service

                  Comment


                    #10
                    When I said the program would not respond I meant it would not do what I expected of it. Can you spell out what you say? I mean write it down in your response, like this: right now to link set 1 to set 2 this is what I am doing: in "Do the following:" of set 1 I put a last line of Variable0=0 (I assume this means that this entire "set" whatever is found from it is given value variable0, then in set 2 I put a first line of Variable0==Variable1 in the "When the following conditions are true:", this means that set 2 uses or starts from what is found in set 1 (in other words set 1 has to be found and then that value which is found in set 1 is the first value used in set 2). Then in "Do the following:" of set 2 I put a first line of Variable0=1 (I assume this means that now what ever is found in set two will be used as the first value for its "Do the following:". Now I assume if I want to continue this linking I need to put a last line of Variable1=1 in set 2 "Do the following:" section and then in set 3 start the "When the following conditions are true:" with Variable1==Variable2.

                    In addition if I want to recall any value at a later set I can recall it by putting VariableX==VariableY as the first line of "When the following conditions are true:" where X is the value of want to recall, and Y is the new set that I want to start from value X.

                    Please let me know if this is correct, or better just type exactly how this would be done. I have not had time to check the above yet but it sounds logical to me. Thank you.

                    Comment


                      #11
                      Hello bijan,
                      Thanks for writing in and I am replying for Bertrand.

                      You can link between 2 sets. Please see the attached picture which demonstrates the idea.

                      Please let me know if I can assist you any further.
                      Attached Files
                      JoydeepNinjaTrader Customer Service

                      Comment


                        #12
                        Thank you the picture and the notations help a lot. I will use this later and I think I can make a success of it. But if not I will be back here.

                        Comment


                          #13
                          I tried your setup but all it does is to put dots on all the candles in the last condition. I did it exactly as per your picture and it put blue dots on all the candles that had a close higher than the previous candle, in other words the first two conditions for SMA cross and ADX being above 25 were ignored. Can you see if you can correct this so that the first two conditions are not ignored? Or there is a chance I am doing something wrong but I tried to check my work several times to make sure it is exactly as the pictures you posted and I can't see a difference.

                          Comment


                            #14
                            Free online storage and sharing with Screencast.com. 2 GB of storage and 2 GB of bandwidth per month for free. We won't compress, alter or take ownership of your content.

                            Comment


                              #15
                              Free online storage and sharing with Screencast.com. 2 GB of storage and 2 GB of bandwidth per month for free. We won't compress, alter or take ownership of your content.

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by fx.practic, 10-15-2013, 12:53 AM
                              5 responses
                              5,404 views
                              0 likes
                              Last Post Bidder
                              by Bidder
                               
                              Started by Shai Samuel, 07-02-2022, 02:46 PM
                              4 responses
                              95 views
                              0 likes
                              Last Post Bidder
                              by Bidder
                               
                              Started by DJ888, Yesterday, 10:57 PM
                              0 responses
                              8 views
                              0 likes
                              Last Post DJ888
                              by DJ888
                               
                              Started by MacDad, 02-25-2024, 11:48 PM
                              7 responses
                              159 views
                              0 likes
                              Last Post loganjarosz123  
                              Started by Belfortbucks, Yesterday, 09:29 PM
                              0 responses
                              8 views
                              0 likes
                              Last Post Belfortbucks  
                              Working...
                              X