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
1 registered members (opm), 778 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
Support and Resistance Zones/Cluster #467274
07/24/17 13:49
07/24/17 13:49
Joined: Jul 2017
Posts: 4
TCC Offline OP
Guest
TCC  Offline OP
Guest

Joined: Jul 2017
Posts: 4
Hi all,

I got some simple trading system which works not that bad. One component of the system is the usage of support and resistance zones/price clusters.

Does anyone know if there is a function / indicator already available in Zorro or anywhere else as lite-C script?

I searched all zorro documentation but was not able to find one....

Best wishes
TCC

Re: Support and Resistance Zones/Cluster [Re: TCC] #467292
07/25/17 02:05
07/25/17 02:05
Joined: Dec 2016
Posts: 71
F
firecrest Offline
Junior Member
firecrest  Offline
Junior Member
F

Joined: Dec 2016
Posts: 71
Hi TCC,

I think you need to code it yourself for price clusters detection. I am thinking the code is to find the price range which most of the prices fall in and that is the support and resistance zone.

Regards

Re: Support and Resistance Zones/Cluster [Re: TCC] #467615
08/17/17 03:22
08/17/17 03:22
Joined: Dec 2014
Posts: 204
Germany
Smon Offline
Member
Smon  Offline
Member

Joined: Dec 2014
Posts: 204
Germany
I'm working on a support and resistance indicator. I think the significant price levels are fairly well detected and am now looking for ways to improve it. I'd be happy for any ideas or suggestions to improve it (maybe implement the price levels as structs containing other useful information like the age of the level, how often it was respected or not respected and so on, a return value that tells the script where price is in between two levels / similar to Williams %Range). Send me a message if you want to collaborate!

Code:
// Support and Resistance indicator

function run()
{
	//set(STEPWISE);
	set(PLOTNOW);
	StartDate = 20150101;
	EndDate = 20170301;
	BarPeriod = 1440;
	LookBack = 100; //default - rising this gives more levels to start with
	//BarZone = CET;
	LifeTime = 1;
	

	
	if(is(INITRUN)) printf("nnnnnn===============================");
	
	static var SnR[100]; //array containing all price levels found -> needs to be dynamic in the future
	static int n_SnR = 0; 	//integer needed to fill the support and resistance array
	

	vars Price = series(price());
	//vars Highs = series(priceHigh());    //maybe used later to determine the thickness of the support
	//vars Lows = series(priceLow());      //and resistance levels
	vars Open = series(priceOpen());
	vars Close = series(priceClose());

	var Factor = 0.5;
	
	int Cycle = Factor*DominantPeriod(Price,20);
	
	
	//ZigZag(Price,20*PIP,Cycle*Factor,BLUE);   //replace 20*PIP with ATR to account for volatility and different timeframes...?
	ZigZag(Price,3*ATR(20),Cycle*Factor,BLUE);
	plot("rSlope", rSlope, NEW|SQUARE, BLACK);
	plot("rPeak", rPeak, NEW|SQUARE, BLACK);
	plot("rSign", rSign, NEW|SQUARE, BLACK);
	plot("rLength", rLength, NEW|SQUARE, BLACK);
	plot("Cycle", Cycle, NEW, BLACK);

	vars RSign = series(rSign,2);
	vars RPeak = series(rPeak,2);
	
	
	if (RSign[0] != RSign[1])	//direction changed
	{
		enterLong(); ColorEquity = ColorDD = 0; //just to help the stepwise flag
		//printf("ndirection changed!"); //debugging
		
		int n = min(RPeak[1], LookBack-2); //prevent to look further back than LookBack, otherwise bullshit is happening like SnR[n_SnR] = 0 or SnR[n_SnR] = incredible high number
		
		
		//printf("nnn is: %d", n); //debugging
		//printf("n rPeak[1]-1: %.0f, rPeak[0]: %.0f", RPeak[1]-1, RPeak[0]);
		
		while (n > 0)
			{
			if (rSign < 0) // looking for resistance
				{
				
					if (n == min(RPeak[1], LookBack-2)) //first loop - n still has it's initial value //store maximum of the oldest candle in the SnR array
					{
						//printf("nlooking for resistancenZigZag: %.5f", max(Close[rPeak], Open[rPeak]));
						SnR[n_SnR] = max(Close[n], Open[n]); 
					}
					
					SnR[n_SnR] = max(SnR[n_SnR], max(Close[n+1], Open[n+1])); //compare the subsequent candle and replace the old maximum if a higher price is found  //ZigZag high if its higher (rise lookback!!!)
					//printf("n%dth pot. Res.: %.5f, Max: %.5f", n, SnR[n_SnR], max(Close[n+1], Open[n+1]));
					
					if (n == 1) //last loop
					{
						//printf("nresistance:%.5f, rPeak = %.5f", SnR[n_SnR], max(Close[rPeak], Open[rPeak]));
					}
					
				}
				if (rSign > 0) // looking for support
				{
					
					if (n == min(RPeak[1], LookBack-2)) //first loop - n still has it's initial value //store min of the oldest candle in the SnR array
					{
						//printf("nlooking for supportnnZigZag: %.5f", max(Close[rPeak], Open[rPeak]));
						SnR[n_SnR] = min(Close[n], Open[n]);
					}
					
					SnR[n_SnR] = min(SnR[n_SnR], min(Close[n+1], Open[n+1])); //compare the subsequent candle and replace the old minimum if a lower price is found //ZigZag low if its lower (rise lookback!!!)
					//printf("n%dth pot. Sup.: %.5f, Min: %.5f", n, SnR[n_SnR], min(Close[n+1], Open[n+1]));
					
					if (n == 1) //last loop
					{
						//printf("nsupport:%.5f, rPeak = %.5f", SnR[n_SnR], min(Close[rPeak], Open[rPeak]));
					}
			}
			n--;	
			}
		
		n_SnR++; //prepare to write into next slot in the SnR array
		
		if(n_SnR > 99)
		{
			n_SnR = 0;			
			//as the S&R Array is still static, this will overwrite the oldest values to prevent errors.
		}
	}
	
	int n;
	for(n=0; n<100; n++)
	{
		if(SnR[n] != 0)
		{
			if(is(EXITRUN))
			{
				
				sortData(SnR, 100);
				printf("n%dth Price level: %.5f", n, SnR[n]);
				print(TO_CSV, "nPrice: %.5f", SnR[n]);
				//I need to write something other than just the price
				//Excel has problems with interpreting the numbers / komma is separator in Germany
				//Fixing this with STRG + H (replace "Price: " with nothing) in Excel
			}
			plot("SnR", SnR[n], MAIN|SQUARE, RED); //plot only the recent level
			//plot(strf("SnR_%d", n), SnR[n], MAIN|SQUARE, RED); //plot all levels in the array; behaving strange
			
		}
	}	
}


Re: Support and Resistance Zones/Cluster [Re: Smon] #474966
11/15/18 13:10
11/15/18 13:10
Joined: Oct 2018
Posts: 79
S
SnoopySniff Offline
Junior Member
SnoopySniff  Offline
Junior Member
S

Joined: Oct 2018
Posts: 79
How is your experience so far with the support / resistance approach? Is it worth it to look into it?

Re: Support and Resistance Zones/Cluster [Re: Smon] #486414
08/16/22 18:58
08/16/22 18:58
Joined: Aug 2022
Posts: 12
N
nerdkorea Offline
Newbie
nerdkorea  Offline
Newbie
N

Joined: Aug 2022
Posts: 12
Do you have a finalized version of this Support and Resistance? This stuff seems like a really good way to get SR


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1