NexusFi: Find Your Edge


Home Menu

 





Lowest Bar with the largest range


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one Quick Summary with 1 posts (0 thanks)
    2. looks_two needpips with 1 posts (0 thanks)
    3. looks_3 kaywai with 1 posts (0 thanks)
    4. looks_4 Fat Tails with 1 posts (1 thanks)
    1. trending_up 3,629 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?
Thanks Mike. Godspeed.
The Elite Circle
No book, only a stair: journaling fills where price move …
Cryptocurrency
Iran Lebanon Problem Kills Switzerland Talks, Brent at $ …
Prediction Markets & Event Contracts
Netherlands & Germany Surge as World Cup Field Narro …
Prediction Markets & Event Contracts
Czechia Live at 52.5% as England Rides 4-2 Wave to Co-Fa …
Prediction Markets & Event Contracts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Want your NinjaTrader indicator created, free?
5 thanks
Denied 20K payouts: Alpha Futures
1 thanks
FootPrintV2 Chart for NT8
1 thanks
BERN ALGOS algo trading journal
1 thanks
Afternoon-close session
1 thanks
  #3 (permalink)
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Legendary 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,117



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