Discretionary Supply Zones across a specific discretionary price level

T

Trading51

Active member
2019 Donor
Need help would like to be able to have discretionary supply zones in the form of a cloud just like the zigzag supply zones, need help would like to plot at least for discretionary levels. Thanks. A cloud-like this red and green.

 
T

Trading51

Active member
2019 Donor
@tomsk being that you have made a code like (ZiZag) this would you be able to make this small code so I could mark off discretionary supply zones thanks
 
T

tomsk

Well-known member
VIP
I've not personally done any ZZ studies from scratch so don't think I can help much with your request. All's I did was to restructure the ZZ Logic in an existing ZigZag study that looked real interesting in order to digest it better. If you have a base study I'll certainly look at that but can't promise you anything though. Several years ago I've even looked at an RSI study and played around with the ZZ code in that. context What a learning experience it was with that I can tell you
 
T

Trading51

Active member
2019 Donor
@tomsk this is what I have, maybe you can help adjust this all I need to do is change this area I think (PaintingStrategy.Line), im trying to form a line that has something similar to the supply zone, I have grey lines im trying to get them wider and have color like in the first post, a thick colored line, let me know.

declare upper;

input level1 = 3305;
input level2 = 0;
input level3 = 0;
input level4 = 0;

def sLevel1 = level1;
def sLevel2 = level2;
def sLevel3 = level3;
def sLevel4 = level4;


#level 1
plot pLevel1 = highestall(if isnan(close[-1])then round(sLevel1[1] / ticksize(),0) * ticksize() else double.nan);
pLevel1.setpaintingStrategy(paintingStrategy.LINE_VS_TRIANGLES);
pLevel1.setdefaultColor(color.gray);
pLevel1.setlineWeight(2);
pLevel1.SetHiding(!level1 > 0);
addchartBubble(isnaN(close[3]) && !isnaN(close[4]),"price location" = pLevel1, text = "level2 " + pLevel1, color = Color.White);

#level 2
plot plevel2 = highestall(if isnan(close[-1])then round(slevel2[1] / ticksize(),0) * ticksize() else double.nan);
plevel2.setpaintingStrategy(paintingStrategy.LINE_VS_TRIANGLES);
plevel2.setdefaultColor(color.gray);
plevel2.setlineWeight(2);
plevel2.SetHiding(!level2 > 0);
addchartBubble(isnaN(close[3]) && !isnaN(close[4]),"price location" = plevel2, text = "Level1 " + plevel2, color = Color.White);

#level 3
plot plevel3 = highestall(if isnan(close[-1])then round(slevel3[1] / ticksize(),0) * ticksize() else double.nan);
plevel3.setpaintingStrategy(paintingStrategy.LINE_VS_TRIANGLES);
plevel3.setdefaultColor(color.gray);
plevel3.setlineWeight(2);
plevel3.SetHiding(!level3 > 0);
addchartBubble(isnaN(close[3]) && !isnaN(close[4]),"price location" = plevel3, text = "Main Level " + plevel3, color = Color.White);

#level 4
plot plevel4 = highestall(if isnan(close[-1])then round(slevel4[1] / ticksize(),0) * ticksize() else double.nan);
plevel4.setpaintingStrategy(paintingStrategy.LINE_VS_TRIANGLES);
plevel4.setdefaultColor(color.gray);
plevel4.setlineWeight(2);
plevel4.SetHiding(!level4 > 0);
addchartBubble(isnaN(close[3]) && !isnaN(close[4]),"price location" = plevel4, text = "Main Level " + plevel4, color = Color.White);

 
T

tomsk

Well-known member
VIP
As far as I can see, all your code does is to plot horizontal lines at user defined levels via the input statement. Only 1 level is set, the other 3 levels are all set to 0. Don't think I can help progress this further at this stage. From the sounds of things, it seems like you might be looking for some kind of a pivot study. There are at least 5 or 5 standard pivot studies on TOS, and on the OneNote published by Johnny Quotron, there are a whole lot more. Happy hunting!
 
Last edited:
T

Trading51

Active member
2019 Donor
As far as I can see, all your code does is to plot horizontal lines at user defined levels via the input statement. Only 1 level is set, the other 3 levels are all set to 0. Don't think I can help progress this further at this stage. From the sounds of things, it seems like you might be looking for some kind of a pivot study. There are at least 5 or 5 standard pivot studies on TOS, and on the OneNote published by Johnny Quotron, there are a whole lot more. Happy hunting!
I just wanted to change the thickness to the lines in a cloud form so i can add it to specific volume profile areas the areas where price has a reaction, i need lines thicker verse these skinny grey lines, i know its simple but i can't figure out how to code a line to make it thicker in a cloud format
 
T

tomsk

Well-known member
VIP
@Trading51 You lost me there regarding changing the thickness of the lines. As far as I can see you already have the correct code to increase the line thickness. See below. If this is not thick enough, you can replace the "2" in the SetLineWeight statement with either a "3", "4", or "5".

Code:
pLevel1.setlineWeight(2);
 

Similar threads

Top