Check out our Buy the Dip indicator and see how it can help you find profitable swing trading ideas. Scanner, watchlist columns, and add-ons are included.
# Mobius
# Mobius on My Trade
# Support / Resistance
# V01.06.2012 V02.08.2013
# Added lower bar for clouds, Volume condition for plot and Vertical line for time.
input n = 13;
input ShowLines = yes;
input PlotTime = 1215; #hint PlotTime: Enter Bars End to plot Bars Start 0 for none.
def h = high;
def l = low;
def v = volume;
def Firstbar = barNumber();
def Highest = fold i = 1 to n + 1
with p = 1
while p
do h > getValue(h,-i);
def HVn = if V == Highest(v, n)
then l
else Double.NaN;
def A = if (Firstbar > n
and h == highest(h, n)
and Highest)
and HVn
then h
else double.NaN;
def Alow = if (Firstbar > n
and h == highest(h, n)
and Highest)
and HVn
then l
else double.nan;
def Lowest = fold j = 1 to n + 1
with q = 1
while q
do l < getValue(l, -j);
def B = if (Firstbar > n
and l == lowest(l, n)
and Lowest)
and HVn
then l
else double.NaN;
def Bhigh = if (Firstbar > n
and l == lowest(l, n)
and Lowest)
and HVn
then h
else double.nan;
def Al = if !isNaN(A)
then A
else Al[1];
def A2 = if !isNaN(Alow)
then Alow
else A2[1];
def Bl = if !isNaN(B)
then B
else Bl[1];
def B2 = if !isNaN(Bhigh)
then Bhigh
else B2[1];
plot ph = Round(A, 2);
ph.setPaintingStrategy(PaintingStrategy.VALUES_ABOVE);
plot hL = if Al > 0
then Al
else double.NaN;
hL.setHiding(!showLines);
hL.SetPaintingStrategy(PaintingStrategy.Dashes);
hL.SetDefaultColor(Color.Yellow);
plot hL2 = if A2 > 0
then A2
else double.nan;
hL2.setHiding(!showLines);
hL2.SetPaintingStrategy(PaintingStrategy.Dashes);
hL2.SetDefaultColor(Color.Yellow);
AddCloud(hL, hL2, Color.Light_Red, Color.Light_Red);
plot pl = Round(B, 2);
pl.setPaintingStrategy(PaintingStrategy.VALUES_BELOW);
plot ll = if Bl > 0
then Bl
else double.NaN;
ll.setHiding(!showLines);
ll.SetPaintingStrategy(PaintingStrategy.Dashes);
ll.SetDefaultColor(Color.Blue);
plot lH = if B2 > 0
then B2
else Double.NaN;
lH.setHiding(!showLines);
lH.SetPaintingStrategy(PaintingStrategy.Dashes);
lH.SetDefaultColor(Color.Blue);
AddCloud(ll, lH, Color.Light_Green, Color.Light_Green);
# Time Markers
AddVerticalLine(SecondsTillTime(PlotTime) == 0, "", Color.Red, Curve.Short_Dash);
plot priceLine = highestAll(if isNaN(close[-1])
and !isNAN(close)
then close
else Double.NaN);
priceLine.SetStyle(Curve.Long_Dash);
priceLine.SetDefaultColor(CreateColor(75,75,75));
priceLine.SetLineWeight(1);
# End Code
@mc01439 Your link led to a Microsoft login page. I went ahead and posted the direct code below for @john3
Rich (BB code):# Mobius # Mobius on My Trade # Support / Resistance # V01.06.2012 V02.08.2013 # Added lower bar for clouds, Volume condition for plot and Vertical line for time. input n = 13; input ShowLines = yes; input PlotTime = 1215; #hint PlotTime: Enter Bars End to plot Bars Start 0 for none. def h = high; def l = low; def v = volume; def Firstbar = barNumber(); def Highest = fold i = 1 to n + 1 with p = 1 while p do h > getValue(h,-i); def HVn = if V == Highest(v, n) then l else Double.NaN; def A = if (Firstbar > n and h == highest(h, n) and Highest) and HVn then h else double.NaN; def Alow = if (Firstbar > n and h == highest(h, n) and Highest) and HVn then l else double.nan; def Lowest = fold j = 1 to n + 1 with q = 1 while q do l < getValue(l, -j); def B = if (Firstbar > n and l == lowest(l, n) and Lowest) and HVn then l else double.NaN; def Bhigh = if (Firstbar > n and l == lowest(l, n) and Lowest) and HVn then h else double.nan; def Al = if !isNaN(A) then A else Al[1]; def A2 = if !isNaN(Alow) then Alow else A2[1]; def Bl = if !isNaN(B) then B else Bl[1]; def B2 = if !isNaN(Bhigh) then Bhigh else B2[1]; plot ph = Round(A, 2); ph.setPaintingStrategy(PaintingStrategy.VALUES_ABOVE); plot hL = if Al > 0 then Al else double.NaN; hL.setHiding(!showLines); hL.SetPaintingStrategy(PaintingStrategy.Dashes); hL.SetDefaultColor(Color.Yellow); plot hL2 = if A2 > 0 then A2 else double.nan; hL2.setHiding(!showLines); hL2.SetPaintingStrategy(PaintingStrategy.Dashes); hL2.SetDefaultColor(Color.Yellow); AddCloud(hL, hL2, Color.Light_Red, Color.Light_Red); plot pl = Round(B, 2); pl.setPaintingStrategy(PaintingStrategy.VALUES_BELOW); plot ll = if Bl > 0 then Bl else double.NaN; ll.setHiding(!showLines); ll.SetPaintingStrategy(PaintingStrategy.Dashes); ll.SetDefaultColor(Color.Blue); plot lH = if B2 > 0 then B2 else Double.NaN; lH.setHiding(!showLines); lH.SetPaintingStrategy(PaintingStrategy.Dashes); lH.SetDefaultColor(Color.Blue); AddCloud(ll, lH, Color.Light_Green, Color.Light_Green); # Time Markers AddVerticalLine(SecondsTillTime(PlotTime) == 0, "", Color.Red, Curve.Short_Dash); plot priceLine = highestAll(if isNaN(close[-1]) and !isNAN(close) then close else Double.NaN); priceLine.SetStyle(Curve.Long_Dash); priceLine.SetDefaultColor(CreateColor(75,75,75)); priceLine.SetLineWeight(1); # End Code
I wouldn't call this a course. My goal is zero fluff. I will jump right into my current watchlist, tell you the ThinkorSwim indicator that I'm using, and past trade setups to help you understand my swing trading strategy.
Join useThinkScript to post your question to a community of 21,000+ developers and traders.
Start a new thread and receive assistance from our community.
useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.
We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.
If you are new, or just looking for guidance, here are some helpful links to get you started.