Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
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
4 registered members (TipmyPip, AndrewAMD, dBc, clonman), 18,621 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
Chart for differences from day open price #413310
12/11/12 22:04
12/11/12 22:04
Joined: Nov 2012
Posts: 6
N
NightWalker Offline OP
Newbie
NightWalker  Offline OP
Newbie
N

Joined: Nov 2012
Posts: 6
Hi, I'm writing excercises to know better Zorro.

Below you can find script, which calculates and plots differences for every hour bar from daily open (fx).

Code:
// Script generates chart for differences between day open price (midnight for fx market) and every bar according to defined bar period.
// author: NightWalker @ Zorro Trader Forum
// version: 20121202.

function run()
{
	BarPeriod = 60; //time frame set to 1 hour
	StartDate = 2012; //testing just for 2012 year
	NumDays = 30; // and only 30 days
	 
	TimeFrame = 24; //switchitng time frame - price series below reference to daily frame (24 * BarPeriod))
	var daily_atr = ATR(1);

	TimeFrame = 1; //switching timeframe to 1 hour and printf debugging info
	printf("\n close = %f, daily-open = %f, atr = %f", priceClose(0), priceOpen(hour(0)), daily_atr);
	
	var pricediff = (priceClose(0) - priceOpen(hour(0)))/daily_atr*PIP; //calculate difference in price
	// hour(0) means current price, so priceOpen(hour(0)) points to daily open (for fx markets - midnight))

	if ( hour(0) == 0)	// ploting big red bar separating days instead of first hour bar
		plot("new day", daily_atr, BARS, RED);
	else
		plot("price differences", pricediff, BARS, BLUE);	//plot price difference for current bar
		
	PlotHeight1 = 300;
		
	set(PLOTNOW);
}



NightWalker
Re: Chart for differences from day open price [Re: NightWalker] #419233
03/08/13 05:10
03/08/13 05:10
Joined: Nov 2012
Posts: 19
B
Boris Offline
Newbie
Boris  Offline
Newbie
B

Joined: Nov 2012
Posts: 19
I am curious as to how you would go about calculating differences between the closing on Friday and Opening Price on Sunday for gap trading strategies? Any ideas?


Moderated by  Petra 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1