NexusFi: Find Your Edge


Home Menu

 





Lowest Bar with the largest range


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one kaywai with 1 posts (0 thanks)
    2. looks_two Fat Tails with 1 posts (1 thanks)
    3. looks_3 Quick Summary with 1 posts (0 thanks)
    4. looks_4 needpips with 1 posts (0 thanks)
    1. trending_up 3,451 views
    2. thumb_up 1 thanks given
    3. group 3 followers
    1. forum 3 posts
    2. attach_file 0 attachments




 
Search this Thread
  #1 (permalink)
kaywai
singapore
 
Posts: 131 since Nov 2009
Thanks Given: 11
Thanks Received: 7

Hi,

I'm trying to code a way of determining the lowest bar over a series of bars and if there are more than one bar with the same low, to choose the bar with the largest range.

I thought of using "lowestbar" function but that would only give me the most recent low and would ignore the earlier bars with similar lows.

Any thoughts and ideas?

Regards

Kay Wai


Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Weekend Update: First Qatari LNG Transit Attempted -- IR …
Traders Hideout
March Jobs Report Update: 178K Beat vs 59K Expected, Wag …
Traders Hideout
Iran Ceasefire Surges to 19.5% on US 15-Point Plan -- 82 …
Prediction Markets & Event Contracts
Iran Airspace Collapses 18 Points to 15.5% While Hormuz …
Prediction Markets & Event Contracts
Eurex Eyes Prediction Markets -- Europes Biggest Derivat …
Prediction Markets & Event Contracts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Sober Journey With S&P
21 thanks
2026 Jlab journal
10 thanks
Algo automated / semi-automated trading anyone?
6 thanks
Lady Vols Primer: Trading Volatility Journal
6 thanks
2026 Fire Horse
5 thanks
  #3 (permalink)
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Market Wizard
 
Experience: Advanced
Platform: NinjaTrader
Broker: Interactive Brokers
Trading: Futures & Stocks
Posts: 9,887 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,114



kaywai View Post
Hi,

I'm trying to code a way of determining the lowest bar over a series of bars and if there are more than one bar with the same low, to choose the bar with the largest range.

I thought of using "lowestbar" function but that would only give me the most recent low and would ignore the earlier bars with similar lows.

Any thoughts and ideas?

Regards



Kay Wai

You cannot use the LowestBar method, as it does not take into account the second condition, you need to code this manually.

Just loop through the lows of the last n bars. If you find a lower low, store the index of the bar with the lower low. If you find a low identical to the previous lowest low compare the range of this bar with the range of the bar that belongs to the stored index. Now if the new bar has a larger range than the bar with the identical low, then store the index of the new bar, otherwise do not store it and continue the loop.


Reply With Quote
Thanked by:
  #4 (permalink)
needpips
Nashville, tn
 
Posts: 10 since Mar 2011
Thanks Given: 2
Thanks Received: 1


Fat Tails View Post
You cannot use the LowestBar method, as it does not take into account the second condition, you need to code this manually.

Just loop through the lows of the last n bars. If you find a lower low, store the index of the bar with the lower low. If you find a low identical to the previous lowest low compare the range of this bar with the range of the bar that belongs to the stored index. Now if the new bar has a larger range than the bar with the identical low, then store the index of the new bar, otherwise do not store it and continue the loop.

Wow so much to learn here geeeez


Reply With Quote




Last Updated on May 8, 2011


© 2026 NexusFi®, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Downloads - Top
no new posts