Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Order cancelled

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

    #16
    Hello tb_123,

    Thanks for your reply.

    I would recommend that you make a variable (int) to store the CurrentBar number (for the BarsInProgress the cross happens over). In my example I'll call this crossBar.

    Then to get the bars ago value for this bar on a later bar use CurrentBar - crossBar.

    For example, to see the Close of the crossBar:

    if (CrossAbove(Close, SMA(19))
    {
    crossBar = CurrentBar;
    }

    Then later:

    Print(Close[CurrentBar-crossBar].ToString());


    Please let me know if this does not resolve your inquiry.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #17
      hi patrick,

      i was wondering....
      if you think of an alternative direction, now that you know more of the details...let me know your thoughts in this regard as well...

      looking forward to hearing any recommendations you have...

      thx, tb

      Comment


        #18
        hi patrick,

        sounds like a solution...i'll head in that direction

        have a great extended weekend!
        thx for ALL your help,
        tb

        Comment


          #19
          Hello tb_123,

          I think the method you are attempting will work fine.

          For example lets say BIP (BarsInProgress) 0 is a minute interval and BIP 1 is a tick interval:

          if (BarsInProgress == 1)
          {
          if (CrossAbove(Closes[0], SMA(BarsArray[0], 19))
          {
          crossBar = CurrentBar;
          }
          }

          This is just an example but may offer some insight.


          Please let me know if this is not helpful.
          Chelsea B.NinjaTrader Customer Service

          Comment


            #20
            thx chelsea.....
            you have a great weekend too!

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by CarlTrading, 03-31-2026, 09:41 PM
            1 response
            72 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by CarlTrading, 04-01-2026, 02:41 AM
            0 responses
            39 views
            0 likes
            Last Post CarlTrading  
            Started by CaptainJack, 03-31-2026, 11:44 PM
            0 responses
            63 views
            2 likes
            Last Post CaptainJack  
            Started by CarlTrading, 03-30-2026, 11:51 AM
            0 responses
            63 views
            0 likes
            Last Post CarlTrading  
            Started by CarlTrading, 03-30-2026, 11:48 AM
            0 responses
            53 views
            0 likes
            Last Post CarlTrading  
            Working...
            X