Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy conditions

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

    #16
    You could work with flags for this or change your strategy conditions for entry, most people have this issue because they don't work with CrossAbove / CrossBelow, but just with checking for if something is greater or smaller than a previous value. This of course will evalualate to true longer than 1 bar in most cases. Another way might be to record the barnumber the trade is placed on and then waiting for x bars to pass before another entry is permissioned.

    Comment


      #17
      Originally posted by NinjaTrader_Bertrand View Post
      You could work with flags for this or change your strategy conditions for entry, most people have this issue because they don't work with CrossAbove / CrossBelow, but just with checking for if something is greater or smaller than a previous value. This of course will evalualate to true longer than 1 bar in most cases. Another way might be to record the barnumber the trade is placed on and then waiting for x bars to pass before another entry is permissioned.

      Bertrand, great thinking. I have actually tried all of the above to no prevail except for barnumber. I tried a barnumber technique before but it did not work and someone said that it doesn't work with ATM methods (BarsSinceEntry() ).
      So how would you record the barnumber for example? Would it be in the ATM or in the Strategy?

      Thanks

      Comment


        #18
        You can do it directly in the strategy itself, when your conditions trigger for example a long entry (and you flag permits the entry) and the GetAtmStrategyMarketPosition reports you're long (http://www.ninjatrader-support.com/H...yPosition.html) you can save the current bar to a variable to get the entry barnumber. Then you can set / reset a flag with this info to toggle if further entries are allowed or not.

        Comment


          #19
          Ok let me know if this is right:

          privateint barNumberOfOrder = 0;

          // Condition set 1
          if (Open[0] > EOTVramBars(0.65, 1.3, true).VramUpConfirm[0]
          && orderId.Length == 0
          && atmStrategyId.Length ==
          0
          && CurrentBar > barNumberOfOrder + 10 )

          {
          atmStrategyId = GetAtmStrategyUniqueId();
          orderId = GetAtmStrategyUniqueId();
          AtmStrategyCreate(Action.Buy, OrderType.Market,
          0, 0, TimeInForce.Day, orderId, "AtmStrategyTemplate", atmStrategyId);
          barNumberOfOrder = CurrentBar;
          }


          So that will only execute trade after 10th bar from previous trade?

          Comment


            #20
            jthom,

            At a glance that should do it.
            Josh P.NinjaTrader Customer Service

            Comment


              #21
              Thanks Josh. Will test it out later. Thanks Bertrand for the point of direction.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Mindset, 04-21-2026, 06:46 AM
              0 responses
              105 views
              0 likes
              Last Post Mindset
              by Mindset
               
              Started by M4ndoo, 04-20-2026, 05:21 PM
              0 responses
              150 views
              0 likes
              Last Post M4ndoo
              by M4ndoo
               
              Started by M4ndoo, 04-19-2026, 05:54 PM
              0 responses
              71 views
              0 likes
              Last Post M4ndoo
              by M4ndoo
               
              Started by cmoran13, 04-16-2026, 01:02 PM
              0 responses
              125 views
              0 likes
              Last Post cmoran13  
              Started by PaulMohn, 04-10-2026, 11:11 AM
              0 responses
              79 views
              0 likes
              Last Post PaulMohn  
              Working...
              X