Scalper Buys and Sells

Here’s my incarnation of John Carter’s Scalper Buys and Sells. The methodology is a close approximation of the one described in his book Mastering the Trade. The book is highly recommended. Note the squares are not real-time but will show up once the third bar has confirmed a reversal. (Note: The first posting of this code had a line missing.)

One question I have, which might add some clarity to this chart, is when the signal shows.

Lets say I’m using a “day” candlestick chart. On Monday night I look at the chart and I see that the stock had been trending down, yet today, Monday, the day started normal then by mid day it was far below the lower BB. By the end of the day it was back up again.

For the next 4 days, the stock makes “normal” gains each day.

Which day of the week, and at what time during the day would the signal appear below the Monday candle showing a buy signal?

I have an idea to make this script a little more useful from a timing perspective. Is there a way to make look at multiple time frames, for example, evaluate a 1 minute bar time, a 5 minute bar time, and 15 minute bar time to produce a combined signal?

For example, once 3 1 minute bars have passed to create a signal, you would get a weak “buy”, or sell, depending on which way you’re going, then if after 3 5 minute bars if the same trend has continued, it would “add” to the signal by making stronger, then the same would hold true for the 15 minute bar. The goal would be to have an indicator that travels along the price bars and changes color depending on the combined 1, 5, and 15 minute bars.

Does this make sense?

Thanks for your work you post, btw!

Also, can you point me into a direction to learn thinkscript? The documentation they provide is rather slim, and trying to hack scripts isn’t very educational because I really don’t understand the syntax to begin with.

I got very intrigued by this, so I did setup 8 boxes to watch different time frames. I agree 100% with Greg’s idea above…it could be quite useful!! Also, I too would like to know what you find/found with less lookback (do I understand correctly that it uses 3 bars now)? THANKS A MILLION, BEST ONE I THINK.

Great Job. I modified your script to add the following ..
1) When the second bar shows the reversal, the color white is painted
2) the third bar code is the same as what you have except color changes to green.
Could you verify to see if the logic is right?

Here’s a similar study that I found from a guy named Joshua Corum several months ago… He calls it the Gatsby Indicator. It is a 3 bar study too… and throws signal dots (red and green). His website is
” joshuacorum.spaces.live.com/ ”

Thanks for the addition Jeff. I’m always pleased to see “Hot-Rodded” versions of my code…It would be nice if every now and then a “Based on the indicator at http://www.thinkscripter.com” was thrown in the header but I’m not holding my breath there…More scripts are better for everyone – no complaints from me on that.
Eric

…. how about an indicator which simply indicates that the current bar is not complete…. until it closes

…. for example…. the current bar flashes…. or is highlighted…. while all completed bars appear normal….

…. reason for the request….. how many times have you made a trade based on the current bar….. forgetting that it is not complete….
…. only to watch your trade appear less desirable as the current bar finishes much differently than how you expected it to finish

Here’s a little tweak I made to your code that filters out some of the extra trades. I like fewer indications with higher probability. I also made the dot smaller and magenta and print the dot further from the high/low for visibility. Note: this version prints the dot on the active bar, not 3 bars back (another preference of mine).

The def triggerSell statement is highlighted red when I paste it into ToS but I can’t see what the error is. Although I’m not a ThinkScript expert, there appears to be something missing in that statement. At the end of the first line, should there be an operator between close[2] and close[1]? The clause “and (close[2] close[1])” looks suspicious.

I pasted in your missing “def triggerBuy” line and got no error on that one.

Just recently discovered you great site and will be making a donation. A couple of comments on the Scalping script:

According to Carter, we should only be concerned with the current bar and the next 2 bars ([-1] and [-2]). Your script seems to go out another bar [13]. Also, the 3 bars should have consecutive higher or lower closes, hence I don’t understand the “or’s” in the if statements that define the buy and sell switches.

Finally, I have noticed that the indicator doesn’t pick up the first occuraance if it is a buy signal. I think this is because the buySellSwitch [1] may not be defined at this time. I am a newbee at this so I may be off base.

Please ensure that you use the icons in the upper right of the code window to copy/paste the code. The second icon copies the code straight to your clipboard. If you try to do this manually you will include the line numbers and the code will not work in TOS.

Hey Gang need some help. I have been using the John Carter TTM Scalper in TOS and it works great for longer interday plays as well as scalps. I have been trading crude. It has to be mixed with Market Profile or the Monkey Bars. When they both line up it deadly.

I have plowed through the thread and haven’t found what I looking for. I would like to have the bar that throws signal marked as well as an alert added. I know this is possible but have no clue how to code it.

I’m interested in the mixing of TTM Scalper and Market Profile or Monkey Bars. Can you give an example of this? Perhaps the forum is a better place for this types of interaction but I don’t know how to search by username. Unless you post something and let me know here where you put it (title name), I won’t be able to find it or even know you posted something.

I did this the way you said to paste the code… “Please ensure that you use the icons in the upper right of the code window to copy/paste the code. The second icon copies the code straight to your clipboard.”

But I get an error message that says “Invalid statement: rec usage is not allowed in this context.”

Hi – Looks like I am about 3 years late on this chain! I just very recently have started looking at both TTM Scalper Alert and the Scalper Buy and Sells above. I loaded both in ToS, and watched them on 1 minute charts to see how they respond. What I find disturbing is the retroactive labeling of the pivot. In particular, TTM actually labels the pivot as far as 5 bars after the pivot point that is eventually labeled. I am trying to interpret the code above, but what is causing this? Shouldn’t the study be set up to label the bar that culminates the three consecutive close rule? Right now, the study looks great but it looks like that because it is sneeking a peek into the future and then going back and labeling a bar.

If you read Carter’s book it makes more sense. Yes, the signals require 3 bars to confirm. The signals are not real-time as a result. The idea here is to mark swing points on chart not to trade off the signals.

I see this pile is a few years old. I was wondering if the code above is the final version. I would like to create a strategy from it in order to be able to back test but the dots from the study do not correspond to the TTM_Alert arrows from the original study found in TOS right now.

The code has not changed. However, if you understand how this indicator is supposed to be used (as described in Carter’s book), you will realize that it cannot be backtested and is not designed to be a trading system.

Greg,
That sounds possible. I’ll toss in in the good ideas pile. Unfortunately, the pile is rather large at this point. Unfortunately, the only ThinkScript reference I can find is the one ToS has. I’ve asked for a better reference and never got an answer.
-TS