Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Help with lowest bar

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

    Help with lowest bar

    Hi, I'm trying to create an entry where the current price is 4 ticks above the high of the lowest bar looking back at the last 3 bars.

    I'm using this logic:
    GetCurrentBid() + -4 * TickSize >= LowestBar(High, 3)

    However, when backtesting I consistently enter when this is not true (see attachment). Can someone help me with my logic?

    Thanks,

    Rich
    Attached Files

    #2
    Hello richp6,

    LowestBar returns the number of bars ago the lowest price value occured for the lookback period.

    You may be looking for MIN() instead. It returns the lowest value over the specified lookback period.
    http://www.ninjatrader-support.com/H...inimumMIN.html
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      You're right that is definitely not what I wanted. Is there anyway using the ninja code wizard to capture the high price of the lowest bar in the lookback period, or do I need to do custom code?

      Comment


        #4
        Hi Richp6,

        You would need to custom code for this. The two statements below should work for this.

        int barsAgo = LowestBar(Low, 3);
        double myHighValue = High[barsAgo];
        Ryan M.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by bortz, 11-06-2023, 08:04 AM
        47 responses
        1,602 views
        0 likes
        Last Post aligator  
        Started by jaybedreamin, Today, 05:56 PM
        0 responses
        8 views
        0 likes
        Last Post jaybedreamin  
        Started by DJ888, 04-16-2024, 06:09 PM
        6 responses
        18 views
        0 likes
        Last Post DJ888
        by DJ888
         
        Started by Jon17, Today, 04:33 PM
        0 responses
        4 views
        0 likes
        Last Post Jon17
        by Jon17
         
        Started by Javierw.ok, Today, 04:12 PM
        0 responses
        12 views
        0 likes
        Last Post Javierw.ok  
        Working...
        X