NexusFi: Find Your Edge


Home Menu

 





Support/Resistance Levels Study


Discussion in ThinkOrSwim

Updated
    1. trending_up 164 views
    2. thumb_up 0 thanks given
    3. group 2 followers
    1. forum 1 posts
    2. attach_file 0 attachments




 
Search this Thread

Support/Resistance Levels Study

  #1 (permalink)
 58LesPaul 
Owensboro, KY
 
Platform: TradingView
Trading: ES/NQ
Posts: 198 since Sep 2015
Thanks Given: 196
Thanks Received: 101

Hey Guys/Gals,

I'm currently using TradingView and use a study to draw support and resistance levels. I input these levels in 2 separate spots, one for support and one for resistance. The format is 4977, 4970, 4963-65 (major), 4954, 4945 (major), 4938, 4925-30 (major), 4914, 4910 (major), 4904, 4898-96 (major). the levels with (major) will be a solid line, the levels that comprise an area like 4963-65 will draw a rectangle and levels with nothing beside it will draw a dashed line.

I currently have a simple study in ToS that will draw levels but it seems to be limited to only 3 separate input/levels. Is there a way to have more than 3 inputs in ToS? Here is the study;

input price1 = 0;
input price2 = 0;
input price3 = 0;

plot l1 = price1;
plot l2 = price2;
plot l3 = price3;

I can add more inputs but it won't draw them on the chart.

Is there a way to add more inputs? I would prefer only having 2 inputs, one for support and one for resistance where I can enter the levels like the format above but I don't if that is possible.

Thanks

Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Futures True Range Report
The Elite Circle
Better Renko Gaps
The Elite Circle
ZombieSqueeze
Platforms and Indicators
Deepmoney LLM
Elite Quantitative GenAI/LLM
Exit Strategy
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Get funded firms 2023/2024 - Any recommendations or word …
59 thanks
Funded Trader platforms
37 thanks
NexusFi site changelog and issues/problem reporting
23 thanks
GFIs1 1 DAX trade per day journal
22 thanks
The Program
19 thanks
  #2 (permalink)
 58LesPaul 
Owensboro, KY
 
Platform: TradingView
Trading: ES/NQ
Posts: 198 since Sep 2015
Thanks Given: 196
Thanks Received: 101

I found another study that works but I have to enter every level into the study and then change the line type if its not a major S/R line. But it takes about long to enter into the study as it would just drawing the lines manually. Here's the code I changed to accommodate multiple levels.

input a = 0;
input b = 0;
input c = 0;
input D = 0;
input e = 0;
input f = 0;
input g = 0;
input h = 0;
input i = 0;
input j = 0;
input k = 0;
input l = 0;
input m = 0;
input n = 0;
input o = 0;
input p = 0;
input q = 0;
input r = 0;
input s = 0;
input t = 0;
input u = 0;
input v = 0;
input w = 0;
input x = 0;
input y = 0;
input z = 0;

#determines where lines will be drawn
plot aa = HighestAll(if IsNaN(close[-1]) and !IsNaN(close) then a else Double.NaN);
plot bb = HighestAll(if IsNaN(close[-1]) and !IsNaN(close) then b else Double.NaN);
plot cc = HighestAll(if IsNaN(close[-1]) and !IsNaN(close) then c else Double.NaN);
plot dd = HighestAll(if IsNaN(close[-1]) and !IsNaN(close) then D else Double.NaN);
plot ee = HighestAll(if IsNaN(close[-1]) and !IsNaN(close) then e else Double.NaN);
plot ff = HighestAll(if IsNaN(close[-1]) and !IsNaN(close) then f else Double.NaN);
plot gg = HighestAll(if IsNaN(close[-1]) and !IsNaN(close) then g else Double.NaN);
plot hh = HighestAll(if IsNaN(close[-1]) and !IsNaN(close) then h else Double.NaN);
plot ii = HighestAll(if IsNaN(close[-1]) and !IsNaN(close) then i else Double.NaN);
plot jj = HighestAll(if IsNaN(close[-1]) and !IsNaN(close) then j else Double.NaN);
plot kk = HighestAll(if IsNaN(close[-1]) and !IsNaN(close) then k else Double.NaN);
plot ll = HighestAll(if IsNaN(close[-1]) and !IsNaN(close) then l else Double.NaN);
plot mm = HighestAll(if IsNaN(close[-1]) and !IsNaN(close) then m else Double.NaN);
plot nn = HighestAll(if IsNaN(close[-1]) and !IsNaN(close) then n else Double.NaN);
plot oo = HighestAll(if IsNaN(close[-1]) and !IsNaN(close) then o else Double.NaN);
plot pp = HighestAll(if IsNaN(close[-1]) and !IsNaN(close) then p else Double.NaN);
plot qq = HighestAll(if IsNaN(close[-1]) and !IsNaN(close) then q else Double.NaN);
plot rr = HighestAll(if IsNaN(close[-1]) and !IsNaN(close) then r else Double.NaN);
plot ss = HighestAll(if IsNaN(close[-1]) and !IsNaN(close) then s else Double.NaN);
plot tt = HighestAll(if IsNaN(close[-1]) and !IsNaN(close) then t else Double.NaN);
plot uu = HighestAll(if IsNaN(close[-1]) and !IsNaN(close) then u else Double.NaN);
plot vv = HighestAll(if IsNaN(close[-1]) and !IsNaN(close) then v else Double.NaN);
plot ww = HighestAll(if IsNaN(close[-1]) and !IsNaN(close) then w else Double.NaN);
plot xx = HighestAll(if IsNaN(close[-1]) and !IsNaN(close) then x else Double.NaN);
plot yy = HighestAll(if IsNaN(close[-1]) and !IsNaN(close) then y else Double.NaN);
plot zz = HighestAll(if IsNaN(close[-1]) and !IsNaN(close) then z else Double.NaN);

#Set Color of Lines
aa.SetDefaultColor(color = Color.RED);
bb.SetDefaultColor(color = Color.RED);
cc.SetDefaultColor(color = Color.RED);
dd.SetDefaultColor(color = Color.RED);
ee.SetDefaultColor(color = Color.RED);
ff.SetDefaultColor(color = Color.RED);
gg.SetDefaultColor(color = Color.RED);
hh.SetDefaultColor(color = Color.RED);
ii.SetDefaultColor(color = Color.RED);
jj.SetDefaultColor(color = Color.RED);
kk.SetDefaultColor(color = Color.RED);
ll.SetDefaultColor(color = Color.RED);
mm.SetDefaultColor(color = Color.RED);
nn.SetDefaultColor(color = Color.RED);
oo.SetDefaultColor(color = Color.RED);
pp.SetDefaultColor(color = Color.RED);
qq.SetDefaultColor(color = Color.RED);
rr.SetDefaultColor(color = Color.RED);
ss.SetDefaultColor(color = Color.RED);
tt.SetDefaultColor(color = Color.RED);
uu.SetDefaultColor(color = Color.RED);
vv.SetDefaultColor(color = Color.RED);
ww.SetDefaultColor(color = Color.RED);
xx.SetDefaultColor(color = Color.RED);
yy.SetDefaultColor(color = Color.RED);
zz.SetDefaultColor(color = Color.RED);

It would be convenient if I could just copy/paste the levels for support into one input and the resistance levels into another input. In Tradingview each level was separated with a comma and any level with (major) was a solid line and without (major) was dashed.

Started this thread Reply With Quote




Last Updated on February 3, 2024


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts