Scan current price below/above last days close


Category:
0
0

Just like the title, but I cant find a way in condition wizard to pull it off.

Marked as spam
Posted by (Questions: 11, Answers: 15)
Asked on December 22, 2020 9:40 pm
105 views
0
sorry forgot to add my attempt. — plot belowDclose = if priceType.MARK < close(period=\"DAY\")[1] then 1 else 0; plot below = Belowdclose > 0; working around issue ; cant use plot, def statements with the price type.MARK. I should add I trade 3 5 and 15 mins charts..
( at December 22, 2020 10:05 pm)
0
Private answer

You are probably overthinking this solution. You build this using the daily time frame and then add a condition that checks of the close of the current bar is greater than the close of the previous bar (using the offset parameter on the right side of the condition).

Screenshot below shows how to set this up.

Some comments on the code you provided in the comment below your question.

  1. Within the Thinkorswim language, the current price is always going to be the "close". Not the Mark, the bid, the ask or any other price type. Trust me on this. I have irrefutable evidence this is true. For some reason many users of Thinkorswim are mislead into thinking they have to do some other "trick" to persuade the scan to get the current price. Just use the close. Yes, the close gives you real time price changes real time results.
  2. Within a Study Filter on Thinkorswim only one time frame is permitted. There is no way to reference a secondary aggregation period within the Study Filter of a scan on Thinkorswim. So when you use "close(period = "DAY")" on a Study Filter it does not work.

All you have requested is to check of today's current price is greater than or less than yesterday's close. You just set the Study Filter to Daily time frame and compare the close of the current bar to the close of the previous bar.

Yes, if today's candle changes from red to green this scan will pick that up intraday and in real time. Even though the Study Filter is set to Daily time frame.

Sorry, I know a lot of viewers will be running across this post for years to come and I just wanted to try to answer all of the most common questions that are going to show up in the comments section if I don't provide those answers.

Attachments:
Marked as spam
Posted by (Questions: 37, Answers: 4118)
Answered on December 23, 2020 9:24 am
0
Thank you again Pete. It was that simple after all. Thank you for your advice on only using 'close' and not the other price types. Happy Holidays !
( at December 24, 2020 12:10 pm)