Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Market Position + delay?

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

    Market Position + delay?

    Is it possible to reference Market.Position a bar ago? I would like to have a condition that looks for Market.Position to be Flat a bar ago, but not current bar. Can you have a Flat[1] BoolSeries?
    Thanks

    #2
    Hello kenb2004,

    You can use the TradeCollection to check what position you were in previous but you would have to do a check for what bar that it was on. So it may be easier for you to create a BoolSeries for easier access.
    JCNinjaTrader Customer Service

    Comment


      #3
      So Flat[1] is possible as a BoolSeries?

      Comment


        #4
        Hello kenb2004,

        You would have to create a BoolSeries named Flat but yes it is possible. For Example:

        Code:
        #Variable
        private BoolSeries Flat;
        
        Initialize():
        Flat = new BoolSeries(this);
        
        OnBarUpdate():
        Flat.Set(MarketPosition.Flat == Position.MarketPosition ? true : false);
        JCNinjaTrader Customer Service

        Comment


          #5
          Thanks.....

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by DannyP96, 05-18-2026, 02:38 PM
          1 response
          27 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by CarlTrading, 05-11-2026, 05:56 AM
          0 responses
          117 views
          0 likes
          Last Post CarlTrading  
          Started by CarlTrading, 05-10-2026, 08:12 PM
          0 responses
          69 views
          0 likes
          Last Post CarlTrading  
          Started by Hwop38, 05-04-2026, 07:02 PM
          0 responses
          226 views
          0 likes
          Last Post Hwop38
          by Hwop38
           
          Started by CaptainJack, 04-24-2026, 11:07 PM
          0 responses
          417 views
          0 likes
          Last Post CaptainJack  
          Working...
          X