how to join 3rd wave of elliot?
wave 3 found by:
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © Qantar
//@version=4
study("3x finder",overlay=true,max_bars_back=5000)
//eow=rectracment of end of wave x (eowx)
var eow1=0.7, eow2=0.5, eow3=1.618, s=0
//find start of wave 1
N=bar_index+1, LV=lowest(low,N)
LP=valuewhen(low==LV,bar_index,0)
//mark end of wave 1 and 2
if N>LP
HV=highest(high,N-LP)
HP=valuewhen(high==HV,bar_index,0)
R=HV-LV
FP=HV-eow1*R
BP=HV-eow2*R
LV2V=lowest(low,N-HP)
LV2P=valuewhen(low==LV2V,bar_index,0)
EXP=LV2V+eow3*R
if (LV2V<FP)and(LV2V>LV)and(LV2P>HP)
//label.new(x=LP,y=LV,color=color.red,style=label.style_label_up,textcolor=color.white,text="0")
if (high>=BP)and(N-1>LV2P)and(close>=BP)
alert("wave 3 start")
W0=label.new(x=LP,y=LV,color=color.red,style=label.style_label_up,textcolor=color.white,text="0")
W1=label.new(x=HP,y=HV,color=color.green,textcolor=color.white,text="1")
W2=label.new(x=LV2P,y=LV2V,color=color.orange,style=label.style_label_up,textcolor=color.white,text="2")
label.delete(W0[1])
label.delete(W1[1])
label.delete(W2[1])
TP=LV2V+(1.618*R)
SL=LV2V
Line1=line.new(x1=HP,y1=TP,x2=N+100,y2=TP, color=color.green)
Line2=line.new(x1=HP,y1=SL,x2=N+100,y2=SL, color=color.red)
Label1=label.new(x=N+100,y=TP,color=color.green,textcolor=color.white,text="Target price = "+tostring(TP))
Label2=label.new(x=N+100,y=SL,color=color.orange,textcolor=color.white,text="Stop loss = "+tostring(SL))
line.delete(Line1[1])
line.delete(Line2[1])
label.delete(Label1[1])
label.delete(Label2[1])
if barstate.islast
RRR=(TP-high)/(high-SL)
label.new(x=N-1,y=high,color=color.blue,textcolor=color.white,text="buy \n Risk Reward Ratio = "+tostring(RRR))
fast=ema(close,14)
slow=ema(close,26)
crossover(fast,slow)
barcolor(crossover(fast,slow)? color.blue: crossunder(fast,slow)? color.purple: fast>slow? color.green:color.red)
========================================================================
join with pullbacks:
//@version=3
study(shorttitle = "PBT", title="Pullback Trading [Fhenry0331]", overlay=false)
// Trend Lenght: Cross of 13/26 is used.
ema1length = input(13)
ema2length = input(26)
ema1 = ema(close, 13)
ema2 = ema (close, 26)
//Black cross notates start of trend: aggresive entry can be used at the start of the trend.
//13 ema above 26 ema: Long
//13 ema below 26 ema: short
//Entry should be above the intial bar that that started the trend. The cross "X"
long = ema(close, 13)
short = ema(close, 26)
plot(cross(long, short) ? short : na, style = cross, color = black, linewidth = 4)
//Force Index with a lenght of "2" is used for pullbacks (lenght of "2" will produce a sensitive index)
length = input(2, minval=1)
efi = sma(change(close) * volume, length)
plot(efi, color=blue, title="EFI")
hline(0, title="Zero")
//blue bars for uptrend
cond1 = ema1 > ema2
barcolor (cond1 ? blue : na)
bgcolor (cond1 ? lime : na)
//purple bars for downtrend
cond2 = ema2 > ema1
barcolor (cond2 ? purple : na)
bgcolor (cond2 ? red : na)
//pullback in uptrend. Force Index below zero, but 13 ema is still above 26 ema(still uptrend)
//price closes below 13 ema with the Force Index below the zero line
//notates pullback in an uptrend
//place buy orders above pullback bars notated aqua up triangle and also white background in the indicator
cond3 = efi < 0 and low < ema1 and ema1 > ema2 ? 1:0
plotshape(cond3, style=shape.triangleup, location=location.bottom, color=aqua, transp=0, offset=0)
bgcolor (cond3 ? white : na)
//pullback in downtrend. Force Index above zero, but 26 ema is still above 13 ema (still downtrend)
//price closes above 13 ema with the Force Index above zero
//notates pullback in a downtrnd.
//place sell orders below pullback bars notated red down triangle and also yellow/orange background in the indicator
cond4 = efi > 0 and high > ema1 and ema1 < ema2 ? 1:0
plotshape (cond4, style=shape.triangledown, location=location.top, color=red, transp=0, offset=0)
bgcolor (cond4 ? yellow : na)
Comments
Post a Comment