NexusFi: Find Your Edge


Home Menu

 





Get range of a series of bars


Discussion in MultiCharts

Updated
    1. trending_up 1,996 views
    2. thumb_up 3 thanks given
    3. group 1 followers
    1. forum 2 posts
    2. attach_file 0 attachments




 
Search this Thread
  #1 (permalink)
kristian
Zurich
 
Posts: 8 since Aug 2015
Thanks Given: 4
Thanks Received: 3

Hello

I want to get the range of the bars in at a certain time. Let's say I want the range from 9-10.30. This was my first try, but obviously it doesn't give me the range of the bars as it's only looking at the 9 & 10.30 bars (and not the ones in between).

 
Code
if (Time = 0900) then begin
	storedOpen9 = low;
	storedClose9 = high;
end;
	
if (Time = 1030) then begin
	storedOpen1030 = low;
	storedClose1030 = high;
end;

rangeLow = MinList(MinList(storedOpen9, storedClose9), MinList(storedOpen1030, storedClose1030));	
rangeHigh = MaxList(MaxList(storedOpen9, storedClose9), MaxList(storedOpen1030, storedClose1030));

range = rangeHigh - rangeLow;

Another idea I had was to use 2 different timeframes, one where I use 90mins bars for getting the range (high-low) and one for trading. But I don't know how to do this nor if this is the appropriate way.

I am very new to EasyLanguage & Multicharts and tried searching for this but didn't find anything.

Thanks in advance!


Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Datafeed for Atas
Platforms and Indicators
My Rant with AMP Futures
Trading Reviews and Vendors
Trump Media to sell instant access to market-moving soci …
Traders Hideout
No book, only a stair: journaling fills where price move …
Cryptocurrency
requesting .nrd replay files from 2026 spy and qqq
The Elite Circle
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
BERN ALGOS algo trading journal
3 thanks
NexusFi site changelog and issues/problem reporting
2 thanks
TopStep Trader disappointment
2 thanks
Want your NinjaTrader indicator created, free?
1 thanks
Running trading strategies on a VPS
1 thanks
  #2 (permalink)
 
Jura's Avatar
 Jura   is a Vendor
 
Posts: 775 since Apr 2010
Thanks Given: 2,352
Thanks Received: 691


kristian View Post
I want to get the range of the bars in at a certain time. Let's say I want the range from 9-10.30. This was my first try, but obviously it doesn't give me the range of the bars as it's only looking at the 9 & 10.30 bars (and not the ones in between).

I would try to do this as follows:

 
Code
Variables:
	barRange(0),
	highestRange(0),
	lowestRange(9999);

// Get the range of bars during a certain time
if (Time >= 900) and (Time <= 1030) then begin

	barRange = High - Low;
	
	highestRange = MaxList(barRange, highestRange);
	lowestRange = MinList(barRange, lowestRange);

end;

// Reset the variables after this time ends
if (Time > 1030) then begin

	highestRange = 0;
	lowestRange = 99999;

end;
Of course, you'd still need to implement here what you want to do with the `highestRange` and `lowestRange` variables during the 9:00 - 10:30 time period. I hope this points you in the right direction.


Reply With Quote
Thanked by:
  #3 (permalink)
kristian
Zurich
 
Posts: 8 since Aug 2015
Thanks Given: 4
Thanks Received: 3


Thank you very much Jura!

On the basis of your input I came up with the following:

 
Code
if (Time >= 0700) and (Time <= 0930) then begin
	
	highestHigh = MaxList(High, highestHigh);
	lowestLow = MinList(Low, lowestLow);
	
	range = highestHigh - lowestLow;

end;
and I reset the range every day like this:

 
Code
if date <> date[1] then begin

	highestHigh = 0;
	lowestLow = 99999999;
        range = 0;

end;


Reply With Quote
Thanked by:




Last Updated on August 12, 2015


© 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