Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to ...

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

    How to ...

    ... limit # of trades to 1 entry per indicator reversal. For example, if my strategy was to enter short when the previously upticking SMA10 reverses direction to down, I want just one trade (short) until the SMA10 reverses and goes back up again (at which point I would want just one long trade to kick in). As it is, I am getting new trades posting with every new bar in the direction of the indicator line -- how can I limit it to just one trade until the indicator reverses and, again, at that time just one trade in the opposite direction? Thanks in advance.

    #2
    TakingStock12, I would suggest you setup your rules via a CrossOver instead of just checking for < > in the condition (as this would be true for example for each consecutive bar above / below the SMA thus producing the trade entries you don't want) -

    BertrandNinjaTrader Customer Service

    Comment


      #3
      I see ...

      ... so it cannot be done via strategy wizard? The parameter I'm asking for isn't achieved by a crossover -- just looking for one entry per reversal direction when a line changes directions. Seems simple enough -- would I have to add a line or two of code to the strategy?

      Comment


        #4
        Hello,

        This is Brett following up.

        This can be done in the strategy wizard.


        You would need to use code or a strategy wizard setup that will only trigger once as Bert suggested. You will need to find a way to code your strategy so that it only enters once. Something similar to CrossAbove or CrossBelow depending on what you need.

        You could also use a limiter variable so that you only trade once the variable is set to a value that you check for in your entry conditions. In this case you could add a variable that you set to 1 when you want no more trades to take place and then change back to 0 to allow the strategy to place a trade. Then check for this in your strategy when you place your order. You would need to use some method that the computer would understand so that it knows when your ready to trade again. Such as if the SMA line is higher then the SMA of 5 bars ago, this will need to change based on how your strategy is set up.


        Comment


          #5
          One Entry Per Direction

          If you just want to limit one trade per direction then the Code is : (NT7)

          protected override void Initialize()
          {
          EntriesPerDirection = 1;
          EntryHandling = EntryHandling.AllEntries;
          }

          Or in the parameters for the strategy set the above entries. See attached image.
          Attached Files

          Comment


            #6
            Dave ...

            ... what a breath of fresh air your post is. Thank you! --david

            Comment


              #7
              Hello,

              Be aware that once a profit target or stoploss is reached and your parameters to go long are still good it will immediately submit another long order. Since this is the only thing that limiting it from going long twice at the same time.

              Let me know if I can be of further assistance.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Waxavi, Today, 02:10 AM
              0 responses
              3 views
              0 likes
              Last Post Waxavi
              by Waxavi
               
              Started by TradeForge, Today, 02:09 AM
              0 responses
              8 views
              0 likes
              Last Post TradeForge  
              Started by Waxavi, Today, 02:00 AM
              0 responses
              2 views
              0 likes
              Last Post Waxavi
              by Waxavi
               
              Started by elirion, Today, 01:36 AM
              0 responses
              4 views
              0 likes
              Last Post elirion
              by elirion
               
              Started by gentlebenthebear, Today, 01:30 AM
              0 responses
              4 views
              0 likes
              Last Post gentlebenthebear  
              Working...
              X