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 andrewtrades, Today, 04:57 PM
        1 response
        5 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by chbruno, Today, 04:10 PM
        0 responses
        3 views
        0 likes
        Last Post chbruno
        by chbruno
         
        Started by josh18955, 03-25-2023, 11:16 AM
        6 responses
        436 views
        0 likes
        Last Post Delerium  
        Started by FAQtrader, Today, 03:35 PM
        0 responses
        7 views
        0 likes
        Last Post FAQtrader  
        Started by rocketman7, Today, 09:41 AM
        5 responses
        19 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Working...
        X