Gamestudio Links
Zorro Links
Newest Posts
Blobsculptor tools and objects download here
by NeoDumont. 03/28/24 03:01
Issue with Multi-Core WFO Training
by aliswee. 03/24/24 20:20
Why Zorro supports up to 72 cores?
by Edgar_Herrera. 03/23/24 21:41
Zorro Trader GPT
by TipmyPip. 03/06/24 09:27
VSCode instead of SED
by 3run. 03/01/24 19:06
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (Imhotep, opm), 785 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sakolin, rajesh7827, juergen_wue, NITRO_FOREVER, jack0roses
19043 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Range Breakout #436376
01/24/14 14:10
01/24/14 14:10
Joined: Jul 2013
Posts: 75
R
royal Offline OP
Junior Member
royal  Offline OP
Junior Member
R

Joined: Jul 2013
Posts: 75
Hi guys!
I am trying to implement a simple range breakout system and have problems with getting the high and the low of the 2 o'clock to 10 o'clock range.

Code:
function Range(){
	
	  if(lhour(CET) >= 2 && lhour(CET) <= 10){

			vars Highs = series(priceHigh());
			vars Lows = series(priceLow());
			int i;
			int j;
	
			for(i=0;i<sizeof(Highs);i++){
				if(Highs[i] > Highs[i+1])
					return Highs[i];
				else
					return Highs[i+1];	
				
			}
			
			for(j=0;j<sizeof(Lows);j++){
				if(Lows[j] < Lows[j+1])
					return Lows[j];
				else
					return Lows[j+1];	
				
			}

	  } 
}



Is there an easier way to get the max/min of a series?
And when I call the Range function I get the Error 41 because the series depends on the if condition. How can I get only the 2-10 range?

Thanks in advance for any help! laugh

Re: Range Breakout [Re: royal] #436378
01/24/14 14:56
01/24/14 14:56

L
liftoff
Unregistered
liftoff
Unregistered
L



I think you can use the HH and LL functions here.

Re: Range Breakout [Re: ] #436383
01/24/14 15:35
01/24/14 15:35
Joined: Jul 2013
Posts: 75
R
royal Offline OP
Junior Member
royal  Offline OP
Junior Member
R

Joined: Jul 2013
Posts: 75
Yes HH and LL could be right, nevertheless I don't know how to use them here.

I try to implement the following, but I have problems with seperating the range frown

// range: 02:00-10:00 o'clock
// sell: < rangeLow && < hourly close price ema: 14
// buy: > rangeHigh && > hourly close price ema: 14
// takeprofit: 4.9* range
// stoploss: range
// tradeClose: 22:00 o'clock

Last edited by royal; 01/24/14 15:35.
Re: Range Breakout [Re: royal] #436397
01/24/14 21:02
01/24/14 21:02
Joined: Aug 2013
Posts: 124
D
DMB Offline
Member
DMB  Offline
Member
D

Joined: Aug 2013
Posts: 124
There was someone trying to write code to do this sometime in the last couple months. I can't find the thread but I am pretty sure they got it sorted out. Sorry I couldn't be more help, but the thread is on the forum somewhere. Maybe someone else remembers. I think they were complicating things by using multiple time frames until someone suggested the cleaner HH / LL solution.

Re: Range Breakout [Re: DMB] #436405
01/25/14 03:35
01/25/14 03:35
Joined: Aug 2013
Posts: 124
D
DMB Offline
Member
DMB  Offline
Member
D

Joined: Aug 2013
Posts: 124

Re: Range Breakout [Re: DMB] #436420
01/25/14 15:15
01/25/14 15:15
Joined: Jul 2013
Posts: 75
R
royal Offline OP
Junior Member
royal  Offline OP
Junior Member
R

Joined: Jul 2013
Posts: 75
Thank you DMB. I will have a closer look at it next week laugh


Moderated by  Petra 

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