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.

    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

        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 furelaong, Yesterday, 11:04 PM
                0 responses
                3 views
                0 likes
                Last Post furelaong  
                Started by futurenow, 12-06-2021, 05:49 PM
                19 responses
                997 views
                0 likes
                Last Post Redders
                by Redders
                 
                Started by mathfrick2023, 05-08-2025, 12:51 PM
                8 responses
                106 views
                0 likes
                Last Post Yogaman
                by Yogaman
                 
                Started by several, 04-22-2025, 05:21 AM
                1 response
                276 views
                0 likes
                Last Post Lukasxgtx  
                Started by NTEducationTeam, 06-12-2025, 02:30 PM
                0 responses
                40 views
                0 likes
                Last Post NTEducationTeam  
                Working...
                X