NexusFi: Find Your Edge


Home Menu

 





Determining high low time on multi timeframe data


Discussion in EasyLanguage Programming

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




 
Search this Thread

Determining high low time on multi timeframe data

  #1 (permalink)
 FB2012 
Munich Germany
 
Experience: Beginner
Platform: MultiCharts .NET,MultiCharts,Amibroker
Broker: Interactive Brokers IQFeed
Trading: Stocks,Index CFDs
Posts: 149 since Aug 2012
Thanks Given: 81
Thanks Received: 84

I want to display the time of the high and low on a daily bar based indicator.
Therefore, a 1 minute data was added to the daily data, which can be referenced in the indicator.
My idea was to realize it with a while loop starting when the end of the session is reached on data2.
Counting till the start of the session. However, I was not able to count back more than 150 bars i was noticed that the end of available bars was reached with 203 bars. But I am using 200days back for the minute and 200days back for the daily dataset. Therefore, this should be not the problem. It would be nice if somebody can help me out.

 
Code
Inputs:
SessionStart(900),SessionEnd(1630);
	
Vars:
	tHigh(0),tlow(0),counter(0),lnow(0),hnow(0);

if Time data2 = sessionendtime(0,1) data2 then
begin
	counter=0;
	hnow  =high data2;
	lnow  =low data2;
	while  counter < 150 begin
		if hnow < high[counter] data2  then begin 
			hnow = high[counter] data2;
			tHigh=Time[counter] data2;
		end;
		if lnow > low[counter] data2 then begin
			lnow = low[counter] data2;
			tlow= Time[counter] data2;		
		end;
		counter=counter +1;
	end;
end;

plot1(tlow);

Visit my NexusFi Trade Journal Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
Trade idea based off three indicators.
Traders Hideout
What broker to use for trading palladium futures
Commodities
REcommedations for programming help
Sierra Chart
ZombieSqueeze
Platforms and Indicators
 
  #3 (permalink)
 FB2012 
Munich Germany
 
Experience: Beginner
Platform: MultiCharts .NET,MultiCharts,Amibroker
Broker: Interactive Brokers IQFeed
Trading: Stocks,Index CFDs
Posts: 149 since Aug 2012
Thanks Given: 81
Thanks Received: 84


Ok even if it is not following my first idea, the following code solved my problem.
However, in this implementation there is no backward looking loop and it only uses the incoming data stream order.
Therefore, I am still convinced that it should be possible to look back more bars on the minute data stream than can be referenced on the daily data stream. I would consider that error as a bug or a feature request within Multicharts.

 
Code
Inputs:
	sessionStart(931),sessionEnd(1600);
Vars:
	tlow(0,data1),thigh(0,data1),
	tlow2(0,data2),thigh2(0,data2),
	hnow(0,data2),lnow(0,data2);
	
if Time of data2 = sessionStart then 
begin
	
	hnow = high of data2;
	lnow = low of data2;
	tlow2 = Time of data2;
	thigh2 = Time of data2;
end
else
begin
	print(lnow);
	if high of data2 > hnow[1] then 
	begin
	 	hnow = high of data2;
	 	thigh2 = Time of data2;
	end
	else
	begin
		hnow = hnow[1];
		thigh2= thigh2[0];
	end;
	if low of data2 < lnow[1] then 
	begin 
		lnow = low of data2;
		tlow2 = Time of data2;
	end
	else
	begin 
		lnow = lnow[1];
		tlow2 = tlow2[1];
	end;
end;

if time of data2 = sessionendtime(0,1) then 
begin
tlow = tlow2;
thigh = thigh2;
end;

plot1(thigh);
plot2(tlow);
Having implemented this with much less effort than I have used for the .NET variant, I am absolutly impressed about the ease of use of the easylanguage version. The concept of multiple data streams is just awesome.

Visit my NexusFi Trade Journal Started this thread Reply With Quote




Last Updated on December 25, 2013


© 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