Gamestudio Links
Zorro Links
Newest Posts
Instrument Price Zorro Chart
by felixfx. 10/19/19 20:48
Today real live account blown - my experience
by Clifford_B. 10/19/19 17:09
Building Diversified Portfolios - New Paper
by SnoopySniff. 10/18/19 16:23
Indices & metals easier to trade than FX???
by SnoopySniff. 10/18/19 10:08
What are you working on?
by txesmi. 10/17/19 07:00
Ducascopy exporter
by line7. 10/17/19 06:21
AUM Magazine
Latest Screens
The Space Between
Pogostuck: Rage With Your Friends
Worst Case Z
AckCon'18 - Lotter vs the World 2 - Preview Release
Who's Online Now
2 registered members (Bolle, Dooley), 656 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
VillageTalkies, line7, Shutch, Clifford_B, Paulius
18310 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
RangeBar #475899
01/12/19 14:28
01/12/19 14:28
Joined: Feb 2018
Posts: 227
Italy
tradingest Offline OP
Member
tradingest  Offline OP
Member

Joined: Feb 2018
Posts: 227
Italy
Hi guys,

whythe range bar is not costant?

Here I show you the difference between High and Low. Why is not costant? The code used below
Code:
var BarRange = 0.005;
//Range Bar
int bar(vars Open,vars High,vars Low,vars Close)
{
  if(Open[0] != Close[1]) {
    High[0] = max(Open[0],Close[1]);
    Low[0] = min(Open[0],Close[1]);
    Open[0] = Close[1];
  }
  if(High[0]-Low[0] >= BarRange)
    return 1;
  return 4;
}
function run()
{	
	set(PLOTNOW);
	StartDate = 20180601;
	EndDate = 2019;
	BarPeriod = 1;	
	asset("EUR/USD");

	plot("Range",priceHigh()-priceLow() ,NEW,RED);
	
}



thanks

Re: RangeBar [Re: tradingest] #475900
01/12/19 15:53
01/12/19 15:53
Joined: Nov 2016
Posts: 69
USA
J
jrath Offline
Junior Member
jrath  Offline
Junior Member
J

Joined: Nov 2016
Posts: 69
USA
Your code is plotting the difference between price high and low for every bar. It varies.

Try this :

plot("Range",BarRange ,NEW,RED);

J

Re: RangeBar [Re: jrath] #475901
01/12/19 16:01
01/12/19 16:01
Joined: Feb 2018
Posts: 227
Italy
tradingest Offline OP
Member
tradingest  Offline OP
Member

Joined: Feb 2018
Posts: 227
Italy
Originally Posted By: jrath
Your code is plotting the difference between price high and low for every bar. It varies.

Try this :

plot("Range",BarRange ,NEW,RED);

J


Yes, but for definition the difference between High and Low using the RangeBar should be always the same. I really wanted to check this but there's something wrong and I don't understand what.

Can you help me?

Re: RangeBar [Re: tradingest] #475902
01/12/19 16:40
01/12/19 16:40
Joined: Nov 2016
Posts: 69
USA
J
jrath Offline
Junior Member
jrath  Offline
Junior Member
J

Joined: Nov 2016
Posts: 69
USA
Maybe :


Code:
var BarRange = 0.005;

//Range Bar
int checkBar(vars Open,vars High,vars Low,vars Close)
{
  if(Open[0] != Close[1]) {
    High[0] = max(Open[0],Close[1]);
    Low[0] = min(Open[0],Close[1]);
    Open[0] = Close[1];
  }
    
  if(High[0]-Low[0] >= BarRange)
    return 1;
  return 4;
}

function run()
{	
	set(PLOTNOW);
	StartDate = 2018;
	EndDate = 2019;
	BarPeriod = 1;	
	asset("EUR/USD");

	vars priceOpen = series(priceOpen());
	vars priceHigh = series(priceHigh());
	vars priceLow = series(priceLow());
	vars priceClose = series(priceClose());
		
	plot("Range",checkBar(priceOpen, priceHigh, priceLow, priceClose) ,NEW,RED);
	
}



Gamestudio download | chip programmers | 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