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.
    BertrandNinjaTrader Customer Service

    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.
        BertrandNinjaTrader Customer Service

        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 usazencort, Today, 01:16 AM
              0 responses
              1 view
              0 likes
              Last Post usazencort  
              Started by kaywai, 09-01-2023, 08:44 PM
              5 responses
              603 views
              0 likes
              Last Post NinjaTrader_Jason  
              Started by xiinteractive, 04-09-2024, 08:08 AM
              6 responses
              22 views
              0 likes
              Last Post xiinteractive  
              Started by Pattontje, Yesterday, 02:10 PM
              2 responses
              20 views
              0 likes
              Last Post Pattontje  
              Started by flybuzz, 04-21-2024, 04:07 PM
              17 responses
              230 views
              0 likes
              Last Post TradingLoss  
              Working...
              X