Gamestudio Links
Zorro Links
Newest Posts
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
Release 2.68 replacement of the .par format
by Martin_HH. 09/23/25 20:48
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
1 registered members (dBc), 18,004 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 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,022
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

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