RobertPayne
Member
Any particular reason that most of my posts have been deleted? Have I broken any rules?
Last edited:
Get access to Ben's watchlist, swing trading strategy, ThinkorSwim setup, and trade examples.
Robert, I wasn't notified, but I just help here. @BenTen should be around tonite to explain.Any particular reason that most of my posts have been deleted? Have I broken any rules?
Robert, I wasn't notified, but I just help here. @BenTen should be around tonite to explain.
@Coy Ponish Here is a line of high and low of past 60 bars. Maybe someone else will tackle the rest.
Code:# Line At Price plot priceLine = highestAll(if isNaN(close[-60]) then close else Double.NaN); priceline.SetStyle(Curve.Long_Dash); priceLine.SetLineWeight(2); priceLine.SetDefaultColor(CreateColor(255,215,0)); priceline.HideTitle(); plot pricelinel = lowestall(if isNaN(close[-60]) then close else Double.NaN); pricelinel.SetStyle(Curve.Long_Dash); priceLine.SetLineWeight(2); priceLine.SetDefaultColor(CreateColor(255,215,0)); priceline.HideTitle();
When the CCI crosses below the zero line it can trigger a Down Signal.
I am struggling with the differences between these two conditions:
1. the CCI was above the zero line on the 5th bar before the Down Signal
2. the CCI was above the zero line for all 5 bars before the Down Signal
def cond1 = CCI crosses below 0 and CCI[5] > 0;
CCI[5]
and checks if that bar, and that bar only, was above 0. CCI[3]
would look at the CCI value 3 bars ago.def isAboveZero = cci > 0;
def cond2 = cci crosses below zero and sum(isAboveZero[1], 5) == 5;
def isAboveZero = cci > 0;
is a boolean condition---it can either be TRUE or FALSE. CCI is either above zero (true) or it isn't (false). A true condition has a value of 1 and a false condition has a value of 0. sum()
function to add up the last 5 isAboveZero
boolean values. If that value is equal to 5 then we know that all 5 were above zero.sum(isAboveZero[1], 5)
would be 1 + 1 + 1 + 1 + 1 = 5 and CCI just crossed below zero. So, condition 2 is true.sum(isAboveZero[1], 5)
would be 0 + 0 + 1 + 1 + 1 = 3 and CCI just crossed below zero. So, condition 2 is false.Perfect. Exactly the distinctions i needed to see. Tx.Ok. Let's break this down.
If you are stuck on something, perhaps I can help you figure it out.
I am stuck on a Watchlist Column that is 'looking forward'.
I want to run a scan End of Day and then place some of those tickers into a static watchlist.
The following 3 days i want the column to check for 3 stop-out conditions.
So the column will start with default 0, and end up with a 0, 1, 2, or 3.
Your previous examples were applied to solve almost everything .
But, how do i code the conditions:
def cond1 = is CCI < 0 on Day1 after scanX triggers, on Day2, on Day3
def cond2 =
def cond3 =
Let me rephrase the question.I'm not certain I understand, precisely, what you are going for but this approach may work.
Is your solution still accurate?
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.
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.