Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How Can We Reset EntriesPerDirection??

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

    How Can We Reset EntriesPerDirection??

    Dear Ninja Support,

    I'm working on one of my strategies.
    I have entries per direction set at 10 for example.

    When buy condition:
    Strategy keep making entries until 10 entries reached, strategy then stopped making new entries.

    Now the buy condition turned out to be sell.
    When Sell condition appears:
    I used ExitLong() method and want the strategy to go short and build that 10 short entries. however, the strategy just ignored the ExitLong and stopped making new entries.

    Is this normal??

    #2
    Originally posted by kelvin2088 View Post
    Dear Ninja Support,

    I'm working on one of my strategies.
    I have entries per direction set at 10 for example.

    When buy condition:
    Strategy keep making entries until 10 entries reached, strategy then stopped making new entries.

    Now the buy condition turned out to be sell.
    When Sell condition appears:
    I used ExitLong() method and want the strategy to go short and build that 10 short entries. however, the strategy just ignored the ExitLong and stopped making new entries.

    Is this normal??
    From what you describe here, you Exited Long. If you never asked the Strategy to go short, then it will not.

    Comment


      #3
      Originally posted by koganam View Post
      From what you describe here, you Exited Long. If you never asked the Strategy to go short, then it will not.
      hi koganam,

      actually I asked strategy to go short....but it just didn't ...however, when i set entriesperdirection to larger number like100, it then do what it asked to do...

      Comment


        #4
        Originally posted by kelvin2088 View Post
        hi koganam,

        actually I asked strategy to go short....but it just didn't ...however, when i set entriesperdirection to larger number like100, it then do what it asked to do...
        You now sound then as if you want the strategy to Stop&Reverse when it receives a signal opposite to its current market position. In that case, you do not need to Exit. Just call the opposite entry, and NT will reverse you directly.

        Comment


          #5
          Originally posted by koganam View Post
          You now sound then as if you want the strategy to Stop&Reverse when it receives a signal opposite to its current market position. In that case, you do not need to Exit. Just call the opposite entry, and NT will reverse you directly.
          OMG, that's exactly what I intended to do!
          let me try to change my code and see what happens!

          thx a lot Koganam!

          Comment


            #6
            Originally posted by kelvin2088 View Post
            Dear Ninja Support,

            I'm working on one of my strategies.
            I have entries per direction set at 10 for example.

            When buy condition:
            Strategy keep making entries until 10 entries reached, strategy then stopped making new entries.

            Now the buy condition turned out to be sell.
            When Sell condition appears:
            I used ExitLong() method and want the strategy to go short and build that 10 short entries. however, the strategy just ignored the ExitLong and stopped making new entries.

            Is this normal??
            As you explain, yes that is normal.

            10 buys to 10 sells = flat

            10 buys should never be 20 sells

            I probably would have coded reverse logic for the sell side too...and managed that.

            Are you writing code or using the builder?

            But Koganam's answer is simplest to your 'problem'... But you don't intend to go short without being long first?

            Comment


              #7
              Originally posted by koganam View Post
              You now sound then as if you want the strategy to Stop&Reverse when it receives a signal opposite to its current market position. In that case, you do not need to Exit. Just call the opposite entry, and NT will reverse you directly.
              nope, still not working
              that's weird. do u mind take a look at my code?
              Last edited by kelvin2088; 03-16-2013, 11:35 PM.

              Comment


                #8
                Originally posted by sledge View Post
                As you explain, yes that is normal.

                10 buys to 10 sells = flat

                10 buys should never be 20 sells

                I probably would have coded reverse logic for the sell side too...and managed that.

                Are you writing code or using the builder?

                But Koganam's answer is simplest to your 'problem'... But you don't intend to go short without being long first?
                sorry my bad...actually i set default entriesperdirection =20 instead of 10.

                i intended to accumulate 20 longs in uptrend then reverse position and accumulate as much as 20 shorts, then reverse again...and again...u know..

                Comment


                  #9
                  Originally posted by kelvin2088 View Post
                  nope, still not working
                  that's weird. do u mind take a look at my code?
                  I see in your code that you are using the Set() statement to create your StopLoss. If you use Set() statements, you cannot reverse as I described: you can only do that in a true Stop&Reverse setup, where there are no protective orders, and market direction exit is solely due to a reversal into the opposite position.

                  Comment


                    #10
                    Originally posted by koganam View Post
                    I see in your code that you are using the Set() statement to create your StopLoss. If you use Set() statements, you cannot reverse as I described: you can only do that in a true Stop&Reverse setup, where there are no protective orders, and market direction exit is solely due to a reversal into the opposite position.
                    thx...
                    so using statement like mine cannot handle reversals right?
                    gosh...guess i need to stay awake and do more manual work

                    btw, any recommendation for replacing set statement to ExitLongStop or ExitShortStop?
                    I've no idea how to keep track all the entries. Should I build an arraylist??

                    Comment


                      #11
                      Originally posted by kelvin2088 View Post
                      thx...
                      so using statement like mine cannot handle reversals right?
                      gosh...guess i need to stay awake and do more manual work

                      btw, any recommendation for replacing set statement to ExitLongStop or ExitShortStop?
                      I've no idea how to keep track all the entries. Should I build an arraylist??
                      Well, I tried to take another look at your code, but you seem to have removed it. As a first try, try using a simulated Set() statement. I seem to vaguely remember that in that case, NT does not actually place the order until the StopLoss price is violated, in which case, for all intents and purposes, you do have an unprotected position that will be reversed by the opposite order. Let us know how that goes.

                      If it does not work out, we can always code that same setup directly.

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                      0 responses
                      649 views
                      0 likes
                      Last Post Geovanny Suaza  
                      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                      0 responses
                      370 views
                      1 like
                      Last Post Geovanny Suaza  
                      Started by Mindset, 02-09-2026, 11:44 AM
                      0 responses
                      109 views
                      0 likes
                      Last Post Mindset
                      by Mindset
                       
                      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                      0 responses
                      574 views
                      1 like
                      Last Post Geovanny Suaza  
                      Started by RFrosty, 01-28-2026, 06:49 PM
                      0 responses
                      576 views
                      1 like
                      Last Post RFrosty
                      by RFrosty
                       
                      Working...
                      X