horizontal line on the first candle

mii

Member
Hi,
Could some one please help me with the script which identifies two green higher high candles and draws line on the body of the first candle .
Same with red candles which identifies two higher high red candles and draws a line on the body of the first red candle. Pic attached.
Also need an option to turn off the plots and aggregation selection in settings.
1743025130539.png
 
Last edited:
Solution
Hi,
Could some one please help me with the script which identifies two green higher high candles and draws line on the body of the first candle .
Same with red candles which identifies two higher high red candles and draws a line on the body of the first red candle. Pic attached.
Also need an option to turn off the plots and aggregation selection in settings.

where on the body do you want a line?

wouldnt you want lower lows for red candles?

why do you show lines starting many candles before the signal candles?

what is the max amount of lines you want to see for higher highs? 1,2,3,...?
will need plots and supporting formulas for every line. when you get to 4 green lines and 4 red lines that quite a bit of code.
Hi,
Could some one please help me with the script which identifies two green higher high candles and draws line on the body of the first candle .
Same with red candles which identifies two higher high red candles and draws a line on the body of the first red candle. Pic attached.
Also need an option to turn off the plots and aggregation selection in settings.

where on the body do you want a line?

wouldnt you want lower lows for red candles?

why do you show lines starting many candles before the signal candles?

what is the max amount of lines you want to see for higher highs? 1,2,3,...?
will need plots and supporting formulas for every line. when you get to 4 green lines and 4 red lines that quite a bit of code.
 
Last edited:
Solution

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

where on the body do you want a line?

I drew line in the above picture. its exactly on the body close in uptrend , that will be to identify two green candles and draw on the body close of the first candle ,not on the wick.

wouldnt you want lower lows for red candles?
yes exactly opposite to green scenario

why do you show lines starting many candles before the signal candles?
i didnot get you. what are signal candles?

what is the max amount of lines you want to see for higher highs? 1,2,3,...?
Can this be a selection, where i can select based on time and also number of lines .

I used this code it draws only on the close of the second candle. Could you please extend the lines. i tried but it doesnt work.
def IsUp = close > open;
def IsDown = close < open;
def IsDoji = IsDoji();
def avgRange = 0.05 * Average(high - low, 20);
plot PatternPlot =
IsUp[1] and
IsUp[0] and
high[1] < close[0];

#PatternPlot.SetPaintingStrategy(PaintingStrategy.BOOLEAN_POINTS);
#PatternPlot.SetDefaultColor(GetColor(0));
plot u4 = if PatternPlot then open[0] else Double.NaN;
#plot u4 = close[1];
u4.SetPaintingStrategy(paintingStrategy.HORIZONTAL);
u4.SetPaintingStrategy(PaintingStrategy.DASHES);
u4.SetDefaultColor(Color.magenta);
u4.SetLineWeight(2);
 
where on the body do you want a line?

I drew line in the above picture. its exactly on the body close in uptrend , that will be to identify two green candles and draw on the body close of the first candle ,not on the wick.

wouldnt you want lower lows for red candles?
yes exactly opposite to green scenario

why do you show lines starting many candles before the signal candles?
i didnot get you. what are signal candles?
IS there any book you recommend to master candles.
what is the max amount of lines you want to see for higher highs? 1,2,3,...?
Can this be a selection, where i can select based on time and also number of lines .

I used this code it draws only on the close of the second candle. Could you please extend the lines. i tried but it doesnt work.
def IsUp = close > open;
def IsDown = close < open;
def IsDoji = IsDoji();
def avgRange = 0.05 * Average(high - low, 20);
plot PatternPlot =
IsUp[1] and
IsUp[0] and
high[1] < close[0];

#PatternPlot.SetPaintingStrategy(PaintingStrategy.BOOLEAN_POINTS);
#PatternPlot.SetDefaultColor(GetColor(0));
plot u4 = if PatternPlot then open[0] else Double.NaN;
#plot u4 = close[1];
u4.SetPaintingStrategy(paintingStrategy.HORIZONTAL);
u4.SetPaintingStrategy(PaintingStrategy.DASHES);
u4.SetDefaultColor(Color.magenta);
u4.SetLineWeight(2);
 

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
504 Online
Create Post

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