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 2,963 views
    2. thumb_up 1 thanks given
    3. group 3 followers
    1. forum 3 posts
    2. attach_file 0 attachments




 
Search this Thread

Lowest Bar with the largest range

  #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?
REcommedations for programming help
Sierra Chart
Better Renko Gaps
The Elite Circle
Exit Strategy
NinjaTrader
Trade idea based off three indicators.
Traders Hideout
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Spoo-nalysis ES e-mini futures S&P 500
34 thanks
Just another trading journal: PA, Wyckoff & Trends
30 thanks
Tao te Trade: way of the WLD
24 thanks
Bigger Wins or Fewer Losses?
23 thanks
GFIs1 1 DAX trade per day journal
21 thanks
  #3 (permalink)
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Market Wizard
 
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
Posts: 9,888 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,102



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


© 2024 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 - Privacy Policy - Downloads - Top
no new posts