♥ 0 |
Hi Everyone, I’ve created a scanner for Inside Days as a setup for trades. I have the scanner thinkscript code pasted below. But I’d really like to have the entry and exit visually on the chart (more below). First, for those unfamiliar with Inside Days here’s a definition from Investopedia. “An inside day is often used to signal indecision because neither the bulls nor the bears are able to send the price beyond the range of the previous day. If an inside day is found at the end of a prolonged downtrend and is located near a level of support, it can be used to signal a bullish shift in trend. Conversely, an inside day found near the end of a prolonged uptrend may suggest that the rally is getting exhausted and is likely to reverse.” -Investopedia Here’s the code… —>> def count = 2; <<<—- The above code is used in the scanner – and for the most part works good. But I’d like advice from anyone on how to get the entry prices onto a 1yr/d chart? It would be uber cool to have an entry and exit price for the trade for the next day (both long and short). I’ve attached an example – where the last candle of the day (aka the inside day) will have a price of the high + a penny and the low – a penny. These are long / short entry points for trades on the next day (Market stop). In fact, it should recommend the trend i.e. long or short. In the attached chart, I’ve used KS as an example from Jan 25, 2017 – the ask is to have the long entry position ($24.71 in this example) and the short entry position ($24.28) visually show on the chart. This done manually using the drawing tool / channel and price level in the example. In this example, I’d be going short on the entry on this because the RSI hit an all time high and is moving down and every time it has the stock has come off. A ‘nice to have’ on the chart is the long / short LIMIT (to take your profits) price. This is where you exit the trade (depending on your risk tolerance). So in the example, the spread is 24.70 – 24.29 or $0.40 (rounding) making the long profit exit 25.11 and the profit exit short 23.87 (the stops are another subject altogether but generally are the entry price for the opposite side of the order, e.g. the short stop is 25.11 and the long stop is 23.87 – but I like to add a buffer of 0.05 so I don’t get stopped out too soon). I think I have the scanner logic coded for the ‘inside day’s’ range to be 50% or less of the previous bar’s body (the last bar should be half the size of the prior bar). This will reduce the risk for the trade – you want some room so that the professional traders don’t flush you out, hitting your stop before the trade goes higher (it happens at the start of the trading day… you don’t want to put your stop on too early). I say I think… because I’ve come across a few outliers that don’t look like they’re 50% smaller than the prior day… so any help on the code would be greatly appreciated. Trade with confidence…. Stuart
Marked as spam
|
Please log in to post questions.
Love, love, love it…. ?
Hi Pete, I have found this post very useful, and the codes works perfectly thank you. I just have a quick question with regards to using this scan on the hourly time frame. I have changed aggregation period from D to 1H, however thinkorswim uses the top of the hour when scanning, for example (9:00-10:00), I am wondering if there is a way to scan the 1H time frame on the bottom of the hour for example (9:30-10:30, 10:30-11:30) etc. The chart is able to do this by turning on “start aggregation at market open” option, however this does not effect how the scan is done.
Any help would be greatly appreciated.
thank you.