Gamestudio Links
Zorro Links
Newest Posts
Alternative to Stooq for Zorro S
by cwford. 10/09/26 21:13
Stooq now requires an API key
by cwford. 10/08/26 23:27
ZorroGPT
by TipmyPip. 10/06/26 05:32
Purchase A8 full licence version
by jcl. 10/05/26 12:12
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
4 registered members (JimSimons, TipmyPip, 3run, 1 invisible), 15,917 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
JimSimons, julienp, julienper, KelleyAbbey, Yopachi
19246 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: 66
D
dr_panther Offline OP
Junior Member
dr_panther  Offline OP
Junior Member
D

Joined: Aug 2016
Posts: 66
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: 28,140
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,140
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