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,555 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?
CFTC Opens First COT Report Review in 20 Years -- Asks W …
Traders Hideout
CME Group CEO Calls CFTC-Approved Crypto Perps Dangerous …
Traders Hideout
Memorandum Watch: How the 60-Day MOU Framework Makes May …
Prediction Markets & Event Contracts
Four New E-mini Futures Launch June 29 -- Russell 3000, …
Emini and Emicro Index
April FOMC Minutes: Most Divided Fed Since 1992 -- Many …
Traders Hideout
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
NexusFi site changelog and issues/problem reporting
8 thanks
Darmok and Jalad at Tanagra
3 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