Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (TedMar), 1,420 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Date diff #462128
09/11/16 13:11
09/11/16 13:11
Joined: Aug 2016
Posts: 65
D
dr_panther Offline OP
Junior Member
dr_panther  Offline OP
Junior Member
D

Joined: Aug 2016
Posts: 65
Is there a elegant way to calculate the difference in minutes between two bars/dates?

I am doing this at the moment:
Code:
#include <profile.c>
 
static int start;
function run()
{
	
	
	BarPeriod = 60;
	LookBack  = 1; 
	UnstablePeriod=0;
	 
	StartDate = 20150101;
	EndDate   = 20150102;
	static double atr ;
 
  int bp =  (BarPeriod)/TimeFrame;
 if (Bar==2)
 	start = Bar;
 if (Bar >6)
 		print(TO_WINDOW, "\nBar %d Start =  %d - diff in min %d",Bar, start, (Bar-start)*bp );
 	
 
}


Re: Date diff [Re: dr_panther] #462147
09/12/16 06:42
09/12/16 06:42
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
For the theoretical difference multiply the bar difference with BarPeriod, for the real difference subtract wdate. You can find all time functions on the date/time page.


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1