Gamestudio Links
Zorro Links
Newest Posts
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
0 registered members (), 975 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 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: 61
D
dr_panther Offline OP
Junior Member
dr_panther  Offline OP
Junior Member
D

Joined: Aug 2016
Posts: 61
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