Mastering the Trade

Cribbage

Member
I have an indicator that I wanted to get in working order. Its close, but not quite doing what I want it to and I can't quite tell how its drawing the clouds I'm telling it to. Its based on a strategy John Carter describes in Mastering the Trade. Its a trend reversal strategy where you find the candle the makes the lowest low, and then trade the high of that candle on longs, and vice versa when going short. I came up with the following code to help me see these candles.

Code:
plot LOHP = Lowest(high, 78);
plot LowestLow = Lowest(low, 78);
plot HOLP = Highest(low, 78);
plot HighestHigh = Highest(high, 78);

AddCloud(HOLP, HighestHigh, Color.WHITE, Color.LIGHT_GREEN);
AddCloud(LOHP, LowestLow, Color.RED, Color.WHITE);

Its close, but it isn't always plotting the high of the low (and vice versa) and I can't always tell where its getting its high from. I chose a lookback of 78 because I use this on a 10min chart and thought looking back 2 days was a good place to start. Any help is appreciated.
 
Solution
I have an indicator that I wanted to get in working order. Its close, but not quite doing what I want it to and I can't quite tell how its drawing the clouds I'm telling it to. Its based on a strategy John Carter describes in Mastering the Trade. Its a trend reversal strategy where you find the candle the makes the lowest low, and then trade the high of that candle on longs, and vice versa when going short. I came up with the following code to help me see these candles.

Code:
plot LOHP = Lowest(high, 78);
plot LowestLow = Lowest(low, 78);
plot HOLP = Highest(low, 78);
plot HighestHigh = Highest(high, 78);

AddCloud(HOLP, HighestHigh, Color.WHITE, Color.LIGHT_GREEN);
AddCloud(LOHP, LowestLow, Color.RED, Color.WHITE);

Its close, but...
I have an indicator that I wanted to get in working order. Its close, but not quite doing what I want it to and I can't quite tell how its drawing the clouds I'm telling it to. Its based on a strategy John Carter describes in Mastering the Trade. Its a trend reversal strategy where you find the candle the makes the lowest low, and then trade the high of that candle on longs, and vice versa when going short. I came up with the following code to help me see these candles.

Code:
plot LOHP = Lowest(high, 78);
plot LowestLow = Lowest(low, 78);
plot HOLP = Highest(low, 78);
plot HighestHigh = Highest(high, 78);

AddCloud(HOLP, HighestHigh, Color.WHITE, Color.LIGHT_GREEN);
AddCloud(LOHP, LowestLow, Color.RED, Color.WHITE);

Its close, but it isn't always plotting the high of the low (and vice versa) and I can't always tell where its getting its high from. I chose a lookback of 78 because I use this on a 10min chart and thought looking back 2 days was a good place to start. Any help is appreciated.
Your code above is basically TOS's pricechannel indicator, often referred to as Donchian Channel, with an addition of lowestlow and highesthigh. Nice work by the way.

Researching HOLP/LOHP, I found an open source code on Trading View. Here is that indicator in thinkscript with credit to the author from TV. I could not find this as a commercial indicator by John Carter.


Capture.jpg
Ruby:
Ruby:
#// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
#// © jasonowl
#// The HOLP strategy was developed by trader-author John F. Carter in his book 'Mastering the trade: proven
#// techniques for profiting from intraday and swing trading set ups' (ISBN 0-07-145958-8). The strategy, which gives buy signals, is a reversal strategy.
#// https://www.whselfinvest.com/en/trading_strategies_19_holp.php

#//@version=4
#study(title="HOLP/LOHP", overlay=true)
#float setHigh = na, float setLow = na
#bool buytrigger = 0, selltrigger = 0

#// Input options
input period = 78;#input(20, title="Period")

#// Calculate values
def hiClose = highest(close, period)[1];
def loClose = lowest(close, period)[1];
def sethigh = if low < lowest(low,period)[1]
              then high
              else
              setHigh[1];
def setlow  = if high > highest(high,period)[1]
              then low
              else
              setLow[1];

plot buytrigger = if close crosses above setHigh[1]
                  then low
                  else double.nan;

plot selltrigger = if close crosses below setLow[1]
                   then high
                   else double.nan;


#// Plot values on the chart
plot hclose =hiclose;#(series=hiClose, title="High Close", color=color.green, linewidth=1)
plot lclose =loclose;#(series=loClose, title="Low Close", color=color.red, linewidth=1)
#plotshape(buytrigger, title="Buy", style=shape.triangleup, location=location.belowbar, color=color.lime)
#plotshape(selltrigger, title="Sell", style=shape.triangledown, location=location.abovebar, color=color.orange)
plot shigh=sethigh;#(setHigh, title="HighforTrigger",style=plot.style_circles, linewidth=2, color=color.white)
plot slow=setlow;#(setLow, title="LowforTrigger",style=plot.style
 
Solution

Join useThinkScript to post your question to a community of 21,000+ developers and traders.

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
393 Online
Create Post

Similar threads

Similar threads

The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
  • Exclusive indicators
  • Proven strategies & setups
  • Private Discord community
  • ‘Buy The Dip’ signal alerts
  • Exclusive members-only content
  • Add-ons and resources
  • 1 full year of unlimited support

Frequently Asked Questions

What is useThinkScript?

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.

How do I get started?

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.

What are the benefits of VIP Membership?
VIP members get exclusive access to these proven and tested premium indicators: Buy the Dip, Advanced Market Moves 2.0, Take Profit, and Volatility Trading Range. In addition, VIP members get access to over 50 VIP-only custom indicators, add-ons, and strategies, private VIP-only forums, private Discord channel to discuss trades and strategies in real-time, customer support, trade alerts, and much more. Learn all about VIP membership here.
How can I access the premium indicators?
To access the premium indicators, which are plug and play ready, sign up for VIP membership here.
Back
Top