Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy Wizard inquire

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

    Strategy Wizard inquire

    Hi,

    In Strategy Wizard I want that if first trade is Long then next trade should be taken Short when it comes. Or if first trades is Short then next trade should be taken long.

    awaiting

    #2
    HI mohdfraz, which entry conditions are you using? For a pure reversal strategy you could work with the 'Current market position' from the Strategy category.
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Hi Bretrand,
      I got properitory indicator which generate signals at market reversal points. In strategy wizard in Set1 it will generate long signals and in Set2 it will have conditions to generate Short signals. The indicator can generate long or sell signals more than one time to identify the reversal.

      I cannot use "Current Market Position" script because trade is not going to depend or wait for other signal to exit. Position will exit on give Profit target or stop level and then wait for next entery point.

      so i need some way to tell Ninja that if we get first long then second entery should be short and like wise....


      awaiting

      Comment


        #4
        Please check the attached strategy, it uses UserVariables to achieve your Long / Short switch. Thanks!
        Attached Files
        BertrandNinjaTrader Customer Service

        Comment


          #5
          Awesome Bertrand,,, U r the man,,, Thanks alot,,, It worked great,,, Have a great week.. Thanks

          Comment


            #6
            Originally posted by NinjaTrader_Bertrand View Post
            Please check the attached strategy, it uses UserVariables to achieve your Long / Short switch. Thanks!
            This longshort.zip file was exactly what I was looking for, but I cant understand how "variable0 == 0) and (variable0 = 1) translates to the long short switch.

            Comment


              #7
              Hello katsaf,

              Thank you for your post.

              The Variable0 is changed based on if you go long or chart, this is checked in each condition to see if the Variable0 is 1 or 0.
              Code:
              // Condition set 1
                          if (Close[0] > SMA(10)[0]
                              && [B]Variable0 == 0)[/B]//Check if Variable0 is 0, if so then go long
                          {
                              EnterLong(DefaultQuantity, "");
                              [B]Variable0 = 1;[/B]//Set Variable0 to 1 to go short next
                          }
              
                          // Condition set 2
                          if ([B]Variable0 == 1[/B]
                              && Close[0] < SMA(10)[0])//Check if Variable0 is 1, is if so then go short
                          {
                              EnterShort(DefaultQuantity, "");
                              [B]Variable0 = 0;[/B]//Set Variable0 to 0 to go long next
                          }
              Please let me know if I may be of further assistance.

              Comment


                #8
                Thank you! you've been very helpful.

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by sukhob, 05-18-2023, 08:26 PM
                2 responses
                127 views
                0 likes
                Last Post TraderJA  
                Started by timwey, Yesterday, 10:55 AM
                4 responses
                23 views
                0 likes
                Last Post timwey
                by timwey
                 
                Started by DJ888, 06-28-2024, 10:18 PM
                3 responses
                39 views
                0 likes
                Last Post AdamDJ8
                by AdamDJ8
                 
                Started by ntwong, Yesterday, 08:22 PM
                0 responses
                16 views
                0 likes
                Last Post ntwong
                by ntwong
                 
                Started by Sigma Cypher, 01-08-2022, 06:56 AM
                9 responses
                1,170 views
                0 likes
                Last Post Tbryant
                by Tbryant
                 
                Working...
                X