nie no tu jednak pozwole sobie przytoczyc cytat
LowcaG pisze:hm..czy ja dobrze widzę?
Przekształcenie, jednego wejścia(procentowa zmiana ceny), na nieliniowe wyjście, ma dać jakieś sensowne rezultaty?
Otóż dużo prościej jest, zrobić analizę historyczną tego procentowego "wskaźnika", sprawdzić jak się rozkładał long/short (tu nie ma SL/TP?) narysować, z aproksymować i mamy ten sam wynik, bez sieci neuronowej.
Dodać okienko czasowe analizy, i już mamy dynamicznie uczący się system
Tylko wcześniej spojrzymy czy to w ogóle ma sens, bo wobec takiego wskaźnika mało nasuwa się logicznych wykresów.
Co do tematu, "że musi w czasie rzeczywistym" itd. to też trochę naciągane. To zależy od strategii douczania i nauczania.
zwracam uwage na uzycie przez lowce sformulowania analiza historyczna
zadna symulacja historyczna nie odda efektow reakcji sieci wobec kursu / kursu ktory jest scisle zalezny od spreadow/
a zazwyczaj jest sztucznie usredniany
LowcaG pisze:Wyniki sieci będą zależeć od tego czym ją "nakarmimy".
Tutaj jest tylko na wejściu (i zapewne w nauce) procentowa zmiana ceny oraz kierunek, z czego pewnie chodzi o to czy kolejna świeczka jest na plus czy na minus.
Czyli żadne spready nie są brane pod uwagę.
Co do różnic, w przypadku TF = 1D i procentowej zmiany, nie spodziewał bym się jakiś totalnych różnic.
Strefa czasowa może mieć znaczenie chyba z tego wszystkiego największe.
TF oczywiście można zmieniać, jednak oceniam tylko tę sieć, która jak widzę opiera się na TF 1D
Jak wspomniałem mówię tylko i wyłącznie o tej sieci, a nie ogólnie o sieciach, i uważam, że 7 tys. ludzi ludzi używa stategii opartej de facto o parę ifów, nie oceniam skuteczności, oceniam użycie SNN z jednym parametrem wejściowym.
Co do praktycznych wyników tej sieci, nie wiem co ile ją tam doucza ale ma ona pewną bezwładność, wyznaczoną pewnymi hiperparametrami, i powtórzę niewiele się różni od statystycznie (nawet real time) wyznaczoną funkcją jednego parametru. Jej wyniki zależą pewnie bardziej oa hiperparametrów niż od samych danych wejściowych.
No i to tyle, w sumie nie ma co tu się rozwodzić, każdy widzi (na wrzuconym przeze mnie wykresie) jak wygląda ta funkcja, można oczywiście używać takiej sieci nauronowej do aproksymacji funkcji jednego parametru, ale nie ma co tu się też co podniecać.
hm czym ja by tu nakarmic
dane wejsciowe : / schabowy z ziemniaczkami i koperkiem, polane swiezym maselkiem plus surowki : z marchewki z pomarancza ,seler z orzechem wloskim, kapusta kiszona z buraczkami - mysle ze tak nakarmiona siec powinna byc zadowolona i zostawic suty napiwek
/
sensem projektowania, budowy i istnienia kazdej sieci neuronowej stosowanej na rynkach finansowych /niezaleznie od tego co ma na wadze czy w warstwach / jest predykcja statystyczna
kursu opcji bazujac na przeksztalcaniu danych wejsciowych
kursu - "ceny"
kursu ktory scisle zalezy od spreadow
-- Dodano: 18 maja 2018, 11:34 --
btw : osobiscie nie analizowalem tej sieci bo nie mam na to czasu ani nie weryfikowalem ani twojego wykresu.
nie zajmuje sie takimi rzeczami bo pracuje nad czyms innym :
na przyklad :
//@version=2
//WLASNOSC PRYWATNA - STUDENTA- .WSZELKIE PRAWA ZASTRZEZONE .HYBRYDA PRYWATNA BAZUJACA NA WSKAZNIKACH POWSZECHNIE DOSTEPNYCH PUBLIKOWANYCH PRZEZ METAQUOTES POZNIEJ TRADINGVIEW The GNU General Public License can be found here <
http://www.gnu.org/licenses/>
//ALL RIGHTS RESERVED Copyright 2017 by STYDENT
//HYBRYDA 237
strategy(title='Strategy v3', shorttitle='0030 EU 23 ', overlay=true)
price = close
length = input(34)
hh = highest(high, length)
ll = lowest(low, length)
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
len = 34
src = input(close, title="Candle body resistance Channel")
out = sma(src, len)
//plot(strategy.equity, title="equity", color=red, linewidth=2, style=areabr)
macd_src=close
//****// Divergence Detector *********************************************************************************************************************
// || General Input:
method = input(title='Method (0=RSI, 1=macd, 2=stoch, 3=volume, 4=acc/dist, 5=fisher, 6=cci, 7=BB %B, 8=IdealRSI):', type=integer, defval=7, minval=0, maxval=8)
SHOW_LABEL = input(title='Show Labels', type=bool, defval=true)
SHOW_CHANNEL = input(title='Show Channel', type=bool, defval=false)
uHid = input(true,title="Use Hidden Divergence in Strategy")
uReg = input(true,title="Use Regular Divergence in Strategy")
// || RSI / STOCH / VOLUME / ACC/DIST/ FISHER/ CCI/ BB %B Input:
rsi_smooth = input(title='RSI/STOCH/Volume/ACC-DIST/Fisher/cci Smooth/BB %B length:', type=integer, defval=20)
// || MACD Input:
macd_fast = input(title='MACD Fast:', type=integer, defval=12)
macd_slow = input(title='MACD Slow:', type=integer, defval=26)
macd_smooth = input(title='MACD Smooth Signal:', type=integer, defval=9)
// || Functions:
f_top_fractal(_src)=>_src[4] < _src[2] and _src[3] < _src[2] and _src[2] > _src[1] and _src[2] > _src[0]
f_bot_fractal(_src)=>_src[4] > _src[2] and _src[3] > _src[2] and _src[2] < _src[1] and _src[2] < _src[0]
f_fractalize(_src)=>f_top_fractal(_src) ? 1 : f_bot_fractal(_src) ? -1 : 0
// ||••> START MACD FUNCTION
f_macd(_src, _fast, _slow, _smooth)=>
_fast_ma = sma(_src, _fast)
_slow_ma = sma(_src, _slow)
_macd = _fast_ma-_slow_ma
_signal = ema(_macd, _smooth)
_hist = _macd - _signal
// ||<•• END MACD FUNCTION
// ||••> START ACC/DIST FUNCTION
f_accdist(_smooth)=>_return=sma(cum(close==high and close==low or high==low ? 0 : ((2*close-low-high)/(high-low))*volume), _smooth)
// ||<•• END ACC/DIST FUNCTION
// ||••> START FISHER FUNCTION
f_fisher(_src, _window)=>
_h = highest(_src, _window)
_l = lowest(_src, _window)
_value0 = .66 * ((_src - _l) / max(_h - _l, .001) - .5) + .67 * nz(_value0[1])
_value1 = _value0 > .99 ? .999 : _value0 < -.99 ? -.999 : _value0
_fisher = .5 * log((1 + _value1) / max(1 - _value1, .001)) + .5 * nz(_fisher[1])
// Rolling Moving Average (or Wells Wilders MA)
irma(p,l) =>
irma = (nz(irma[1]) * (l - 1) + p) / l
// RSI function.
irsi(p, l) =>
up = irma(max(change(p), 0), l)
down = irma(-min(change(p), 0), l)
irsi = down == 0 ? 100 : up == 0 ? 0 : 100 - (100 / (1 + up / down))
// --- Start the Homodyne Discriminator Caculations
idealRSI(p) =>
C1 = 0.0962
C2 = 0.5769
Df = 0.5
C3 = (nz(Period[1])*0.075+0.54)
smooth = ((hl2*4.0) + (hl2[1]*3.0) + (hl2[2]*2.0) + (hl2[3]))/10.0
dDeTrend = (smooth*C1 + nz(smooth[2])*C2 - nz(smooth[4])*C2 - nz(smooth[6])*C1)*C3
Q1 = (dDeTrend*C1 + nz(dDeTrend[2])*C2 - nz(dDeTrend[4])*C2 - nz(dDeTrend[6])*C1)*C3
I1 = nz(dDeTrend[3])
jI = (I1*C1 + nz(I1[2])*C2 - nz(I1[4])*C2 - nz(I1[6])*C1)*C3
jQ = (Q1*C1 + nz(Q1[2])*C2 - nz(Q1[4])*C2 - nz(Q1[6])*C1)*C3
I2_ = I1 - jQ
Q2_ = Q1 + jI
I2 = 0.2*I2_ + 0.8*nz(I2[1])
Q2 = 0.2*Q2_ + 0.8*nz(Q2[1])
Re_ = I2*nz(I2[1]) + Q2*nz(Q2[1])
Im_ = I2*nz(Q2[1]) - Q2*nz(I2[1])
Re = 0.2*Re_ + 0.8*nz(Re[1])
Im = 0.2*Im_ + 0.8*nz(Im[1])
dp_ = iff(Re!=0 and Im!=0 , 6.28318/atan(Im/Re) , 0)
II = nz(Period[1])
dp = max(max(min(min(dp_,1.5*II),50),0.6667*II),6)
Period = dp*0.2 + nz(Period[1])*0.8
SmoothPeriod = 0.33*Period + nz(SmoothPeriod[1])*0.67
rsiLen = round((SmoothPeriod*Df)-1) // Get variable RSI length from discriminator
idealRSI = irsi(p,rsiLen) // Generate RSI.
// --- Bollinger Band Vdub BB %B
pcBB(p,l) =>
basis = sma(p, l)
dev = 0.1*stdev(p, l)
upper = basis + dev
lower = basis - dev
pcBB = (p - lower)/(upper - lower)
method_high = method == 0 ? rsi(high, rsi_smooth) :
method == 1 ? f_macd(macd_src, macd_fast, macd_slow, macd_smooth) :
method == 2 ? stoch(close, high, low, rsi_smooth) :
method == 3 ? sma(volume, rsi_smooth) :
method == 4 ? f_accdist(rsi_smooth) :
method == 5 ? f_fisher(high, rsi_smooth) :
method == 6 ? cci(high, rsi_smooth) :
method == 7 ? pcBB(close, rsi_smooth) :
method == 8 ? idealRSI(close) :
na
method_low = method == 0 ? rsi(low, rsi_smooth) :
method == 1 ? f_macd(macd_src, macd_fast, macd_slow, macd_smooth) :
method == 2 ? stoch(close, high, low, rsi_smooth) :
method == 3 ? sma(volume, rsi_smooth) :
method == 4 ? f_accdist(rsi_smooth) :
method == 5 ? f_fisher(low, rsi_smooth) :
method == 6 ? cci(low, rsi_smooth) :
method == 7 ? pcBB(close, rsi_smooth) :
method == 8 ? idealRSI(close) :
na
fractal_top = f_fractalize(method_high) > 0 ? method_high[2] : na
fractal_bot = f_fractalize(method_low) < 0 ? method_low[2] : na
high_prev = valuewhen(fractal_top, method_high[2], 1)
high_price = valuewhen(fractal_top, high[2], 1)
low_prev = valuewhen(fractal_bot, method_low[2], 1)
low_price = valuewhen(fractal_bot, low[2], 1)
regular_bearish_div = fractal_top and high[2] > high_price and method_high[2] < high_prev
hidden_bearish_div = fractal_top and high[2] < high_price and method_high[2] > high_prev
regular_bullish_div = fractal_bot and low[2] < low_price and method_low[2] > low_prev
hidden_bullish_div = fractal_bot and low[2] > low_price and method_low[2] < low_prev
//plot(title='H F', series=fractal_top ? high[2] : na, color=(regular_bearish_div and uReg) or (hidden_bearish_div and uHid)? gray : not SHOW_CHANNEL ? na : black, offset=-2)
//plot(title='L F', series=fractal_bot ? low[2] : na, color=(regular_bullish_div and uReg) or (hidden_bullish_div and uHid) ? gray : not SHOW_CHANNEL ? na : black, offset=-2)
//plot(title='H D', series=fractal_top ? high[2] : na, style=circles, color=(regular_bearish_div and uReg) or (hidden_bearish_div and uHid)? gray : not SHOW_CHANNEL ? na : black, linewidth=3, offset=-2)
//plot(title='L D', series=fractal_bot ? low[2] : na, style=circles, color=(regular_bullish_div and uReg) or (hidden_bullish_div and uHid) ? gray : not SHOW_CHANNEL ? na : black, linewidth=3, offset=-2)
plotshape(title='+RBD', series=not SHOW_LABEL or not uReg? na : regular_bearish_div ? high[2] : na, text='R', style=shape.labeldown, location=location.absolute, size=size.normal,color=#ccff00, textcolor=black, offset=-2)
plotshape(title='+HBD', series=not SHOW_LABEL or not uHid? na : hidden_bearish_div ? high[2] : na, text='H', style=shape.labeldown, location=location.absolute,size=size.normal, color=#ccff00, textcolor=black, offset=-2)
plotshape(title='-RBD', series=not SHOW_LABEL or not uReg? na : regular_bullish_div ? low[2] : na, text='R', style=shape.labelup, location=location.absolute, size=size.normal,color=#ccff00, textcolor=black, offset=-2)
plotshape(title='-HBD', series=not SHOW_LABEL or not uHid? na : hidden_bullish_div ? low[2] : na, text='H', style=shape.labelup, location=location.absolute, size=size.normal,color=#ccff00, textcolor=black, offset=-2)
//++++++//Volty Expan Close Strategy+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
numATRs = input(1)
atrs = sma(tr, length)*numATRs
//plot(strategy.equity, title="equity", color=red, linewidth=2, style=areabr)
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//+++++//Fractals +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
showBarColors = input(false)
// ||--- Fractal Recognition:
filterBW = input(true, title="filter Bill Williams Fractals:")
// ||-----------------------------------------------------------------------------------------------------||
// ||--- Fractal Recognition Functions: ---------------------------------------------------------------||
isRegularFractal(mode) => ret = mode == 1 ? high[4] < high[3] and high[3] < high[2] and high[2] > high[1] and high[1] > high[0] : mode == -1 ? low[4] > low[3] and low[3] > low[2] and low[2] < low[1] and low[1] < low[0] : false
isBWFractal(mode) =>
ret = mode == 1 ? high[4] < high[2] and high[3] <= high[2] and high[2] >= high[1] and high[2] > high[0] : mode == -1 ? low[4] > low[2] and low[3] >= low[2] and low[2] <= low[1] and low[2] < low[0] : false
// ||-----------------------------------------------------------------------------------------------------||
filteredtopf = filterBW ? isRegularFractal(1) : isBWFractal(1)
filteredbotf = filterBW ? isRegularFractal(-1) : isBWFractal(-1)
plotshape(filteredtopf, title='Filtered Top Fractals', style=shape.triangledown, location=location.abovebar, size=size.small,color=red, transp=0,offset=-2)
plotshape(filteredbotf, title='Filtered Bottom Fractals', style=shape.triangleup, location=location.belowbar,size=size.small, color=blue,transp=0, offset=-2)
// ||-----------------------------------------------------------------------------------------------------||
// ||--- Higher Highs, Lower Highs, Higher Lows, Lower Lows -------------------------------------------||
ShowHHLL = input(false)
higherhigh = filteredtopf == false ? false : (valuewhen(filteredtopf == true, high[2], 1) < valuewhen(filteredtopf == true, high[2], 0) and valuewhen(filteredtopf == true, high[2], 2) < valuewhen(filteredtopf == true, high[2], 0))
lowerhigh = filteredtopf == false ? false : ( valuewhen(filteredtopf == true, high[2], 1) > valuewhen(filteredtopf == true, high[2], 0) and valuewhen(filteredtopf == true, high[2], 2) > valuewhen(filteredtopf == true, high[2], 0))
higherlow = filteredbotf == false ? false : ( valuewhen(filteredbotf == true, low[2], 1) < valuewhen(filteredbotf == true, low[2], 0) and valuewhen(filteredbotf == true, low[2], 2) < valuewhen(filteredbotf == true, low[2], 0))
lowerlow = filteredbotf == false ? false : (valuewhen(filteredbotf == true, low[2], 1) > valuewhen(filteredbotf == true, low[2], 0) and valuewhen(filteredbotf == true, low[2], 2) > valuewhen(filteredbotf == true, low[2], 0))
//plotshape(ShowHHLL ? higherhigh : na, title='Higher High', style=shape.square, location=location.abovebar, color=maroon, text="[HH]", offset=-2)
//plotshape(ShowHHLL ? lowerhigh : na, title='Lower High', style=shape.square, location=location.abovebar, color=maroon, text="[LH]", offset=-2)
//plotshape(ShowHHLL ? higherlow : na, title='High Low', style=shape.square, location=location.belowbar, color=green, text="[HL]", offset=-2)
//plotshape(ShowHHLL ? lowerlow : na, title='Lower Low', style=shape.square, location=location.belowbar, color=green, text="[LL]", offset=-2)
// ||-----------------------------------------------------------------------------------------------------||
// ||-----------------------------------------------------------------------------------------------------||
// ||--- Fractals from higher Timeframe: --------------------------------------------------------------||
ShowTimeFractals1 = input(true)
timeframe1 = input("60")
isTFFractal(mode, tf) => ret = mode == 1 ? valuewhen(higherhigh == true, high[2], 0) >= security(tickerid, tf, high) : mode == -1 ? valuewhen(lowerlow == true, low[2], 0) <= security(tickerid, tf, low) : false
higherhhigh = higherhigh == false ? false : isTFFractal(1, timeframe1)
lowerllow = lowerlow == false ? false : isTFFractal(-1, timeframe1)
//*****************************************************************************************************************************************************
plotshape(ShowTimeFractals1 ? higherhhigh : na, title='Timed Top Fractals', style=shape.square, location=location.abovebar,size=size.small, color=maroon, text="FRAKT", offset=-2)
plotshape(ShowTimeFractals1 ? lowerllow : na, title='Timed Bottom Fractals', style=shape.square, location=location.belowbar,size=size.small, color=blue, text="FRAKT", offset=-2)
// ||-----------------------------------------------------------------------------------------------------||
// ||--- V2 : Plot Lines based on the fractals.
showchannel1 = input(false)
//plot(not showchannel1 ? na : (filteredtopf ? high[2] : na), title='Top Channel 1', color=black, offset=-2)
//plot(not showchannel1 ? na : (filteredbotf ? low[2] : na), title='Bottom Channel 1', color=black, offset=-2)
showchannel2 = input(false)
//plot(not showchannel2 ? na : (higherhigh ? high[2] : na), title='Top Channel 2', color=gray, offset=-2)
//plot(not showchannel2 ? na : (lowerlow ? low[2] : na), title='Bottom Channel 2', color=gray, offset=-2)
showchannel3 = input(false)
//plot(not showchannel3 ? na : (higherhhigh ? high[2] : na), title='Top Channel 3', color=silver, offset=-2)
//plot(not showchannel3 ? na : (lowerllow ? low[2] : na), title='Bottom Channel 3', color=silver, offset=-2)
// ||-----------------------------------------------------------------------------------------------------||
// ||--- HLswings channel: unable to offset values
//plot(showchannel ? (highswings ? high[2] : na) : na, color=black, offset=-2)
//plot(showchannel ? (lowswings ? low[2] : na) : na, color=black, offset=-2)
// ||-----------------------------------------------------------------------------------------------------||
// ||---------------------------------------------------------------------------------------------------------------------------------------------------||
// ||--- ZigZag:
showZigZag = input(false)
istop = ShowTimeFractals1 ? (higherhhigh ? true : false) : (filteredtopf ? true : false)
isbot = ShowTimeFractals1 ? (lowerllow ? true : false) : (filteredbotf ? true : false)
topcount = barssince(istop)
botcount = barssince(isbot)
zigzag1 = (istop and topcount[1] > botcount[1] ? high[2] : isbot and topcount[1] < botcount[1] ? low[2] :na )
//zigzag = not showZigZag ? na : ( filteredtopf == true ? high[2] : filteredbotf == true ? low[2] : na )
//plot(not showZigZag ? na : zigzag, title= 'ZigZag', color=black, offset=-2)
// ||-----------------------------------------------------------------------------------------------------||
bc111 = zigzag1 and high[2] == zigzag1 ? red : zigzag1 and low[2] == zigzag1? lime : silver
barcolor(showBarColors ? bc111 : na, offset=-2)
//+++//(title = "Candles", overlay = true
// ++++++ Pivot Points +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
pf = input(true,title="Show Filtered Pivots")
sa = input(true,title="Show Pivot Average")
sh = input(true, title="Show 1 Hour Pivots?")
sf = input(true, title="Show 4 Hour Pivots?")
sd = input(true, title="Show Daily Pivots?")
sw = input(false, title="Show Weekly Pivots?")
sm1 = input(false, title="Show Monthly Pivots?")
sy = input(false, title="Show Yearly Pivots?")
sh3 = input(true, title="Show R3 & S3 Only On 1 Hour & 4 Hour?")
// Classic Pivot
pivot = (high + low + close ) / 3.0
// Filter Cr
bull= pivot > (pivot + pivot[1]) / 2 + .0025
bear= pivot < (pivot + pivot[1]) / 2 - .0025
// Classic Pivots
r1 = pf and bear ? pivot + (pivot - low) : pf and bull ? pivot + (high - low) : pivot + (pivot - low)
s1 = pf and bull ? pivot - (high - pivot) : pf and bear ? pivot - (high - low) : pivot - (high - pivot)
r2 = pf ? na : pivot + (high - low)
s2 = pf ? na : pivot - (high - low)
r3 = sh3 and r1 + (high - low) ? r1 + (high - low) : na
s3 = sh3 and s1 - (high - low) ? s1 - (high - low) : na
//Pivot Average Calculation
smaP = sma(pivot, 3)
//Daily Pivots
dtime_pivot = security(tickerid, 'D', pivot[1])
dtime_pivotAvg = security(tickerid, 'D', smaP[1])
dtime_r1 = security(tickerid, 'D', r1[1])
dtime_s1 = security(tickerid, 'D', s1[1])
dtime_r2 = security(tickerid, 'D', r2[1])
dtime_s2 = security(tickerid, 'D', s2[1])
dtime_r3 = security(tickerid, 'D', r3[1])
dtime_s3 = security(tickerid, 'D', s3[1])
offs_daily = 0
plot(sa and sd and dtime_pivotAvg ? dtime_pivotAvg : na, title="Daily Pivot Average",style=circles, color=orange,linewidth=3)
plot(sd and dtime_pivot ? dtime_pivot : na, title="Daily Pivot",style=cross, color=fuchsia,linewidth=3)
plot(sd and dtime_r1 ? dtime_r1 : na, title="Daily R1",style=cross, color=purple,linewidth=2)
plot(sd and dtime_s1 ? dtime_s1 : na, title="Daily S1",style=cross, color=navy,linewidth=2)
plot(sd and dtime_r2 ? dtime_r2 : na, title="Daily R2",style=cross, color=maroon,linewidth=2)
plot(sd and dtime_s2 ? dtime_s2 : na, title="Daily S2",style=cross, color=#228B22,linewidth=2)
plot(sd and dtime_r3 ? dtime_r3 : na, title="Daily R3",style=cross, color=red,linewidth=3)
plot(sd and dtime_s3 ? dtime_s3 : na, title="Daily S3",style=cross, color=blue,linewidth=3)
//Pivot Point 222 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
width = input(2, minval=1)
xHigh = security(tickerid,"D", high[1])
xLow = security(tickerid,"D", low[1])
xClose = security(tickerid,"D", close[1])
vPP = (xHigh+xLow+xClose) / 3
vR1 = vPP+(vPP-xLow)
vS1 = vPP-(xHigh - vPP)
vR2 = vPP + (xHigh - xLow)
vS2 = vPP - (xHigh - xLow)
vR3 = xHigh + 2 * (vPP - xLow)
vS3 = xLow - 2 * (xHigh - vPP)
//plot(vS1, color=#ff0000, title="S1", style = circles, linewidth = 4)
plot(vS2, color=#ff002a, title="S2", style = circles, linewidth = 4)
//plot(vS3, color=#ff014a, title="S3", style = circles, linewidth = 4)
//plot(vR1, color=#009600, title="R1", style = circles, linewidth = 4)
plot(vR2, color=#006F00, title="R2", style = circles, linewidth = 4)
//plot(vR3, color=#004900, title="R3", style = circles, linewidth = 4)
//OpenRange_PlusTargets EU
sessNum = input(6, title="Session to use (0 = 24 Hours, Other Numbers Listed Below)", minval=0, maxval=6)
desc = input(false, title="Below---Line Plot Start Times and End Times---Change Input Above To Select")
forex_US_BankingOpen = input('0800-1700', type=session, title="1 - Forex U.S. Banks Open -- ALL START TIMES = START OF OPENING RANGE!!!")
gold_US_Open = input('0820-1700', type=session, title="2 - Gold U.S. Open -- All End Times are when Lines Stop Plotting")
oil_US_Open = input('0900-1700', type=session, title="3 - Oil U.S. Open")
usStocksOpen = input('0900-1300', type=session, title="4 - U.S. Cash Cash Session - Stocks Session")
nyForexOpen = input('1300-1600', type=session, title="5 - NY Forex Open")
europeOpen = input('0600-1400', type=session, title="6 - Europe")
pt1 = input(5, minval=1, maxval=15, title="Profit Target 1 - Multiple of Opening Range *.1, 5 = .5, 7 = .7, 10 = 1, 15 = 1.5 etc.")
pt2 = input(10, minval=1, maxval=30, title="Profit Target 2 - Multiple of Opening Range *.1, 10 = 1, 15 = 1.5, 18 = 1.8, etc.")
res = input('60', type=resolution, title="Length Of Opening Range?")
snp = input(true, title="Plot 1 and 2 When 1st and 2nd Profit Target are Achieved?")
//Session Selection Rules
sessToUse = sessNum == 1 ? forex_US_BankingOpen : sessNum == 2 ? gold_US_Open : sessNum == 3 ? oil_US_Open : sessNum == 4 ? usStocksOpen : sessNum == 5 ? nyForexOpen : sessNum == 6 ? europeOpen :'0000-0000'
//Session Rules
bartimeSess = (sessNum == 0 ? time('D') : time('D', sessToUse))
fr2to17 = (sessNum == 0 ? time(period) : time(period, sessToUse))
newbarSess = bartimeSess != bartimeSess[1]
high_range = valuewhen(newbarSess,high,0)
low_range = valuewhen(newbarSess,low,0)
adopt(r, s) => security(tickerid, r, s)
//Formula For Opening Range
highRes = adopt(res, high_range)
lowRes = adopt(res, low_range)
range1 = highRes - lowRes
//Highlighting Line Rules For Opening Range
highColor = high > highRes ? lime : yellow
lowColor = low < lowRes ? red : yellow
//Plot Statements For Opening Range Lines
openRangeHigh = plot(fr2to17 > 0 ? highRes : na, color=highColor, style=circles, linewidth=6)
openRangeLow = plot(fr2to17 > 0 ? lowRes : na, color=lowColor, style=circles, linewidth=6)
//bgcolor(fr2to17 > 0 ? silver : na, transp=85)
//fill(openRangeHigh, openRangeLow, color=silver, transp=70, title="Opening Range Fill")
//Formula For Profit Target 1
pft1 = pt1*.1
highRes2 = highRes+range1*pft1
lowRes2 = lowRes-range1*pft1
//Highlighting Line rules for Profit Target 1
highColor2 = high > highRes2 ? lime : fuchsia
lowColor2 = low < lowRes2 ? lime : fuchsia
//Plots For Profit Target 1
p13=plot(fr2to17 > 0 ? highRes2 : na, color=highColor2, style=circles, linewidth=6)
p14=plot(fr2to17 > 0 ? lowRes2 : na, color=lowColor2, style=circles, linewidth=6)
//Formula For Profit Target 2
pft2 = pt2*.1
highRes3 = highRes+range1*pft2
lowRes3 = lowRes-range1*pft2
//Highlighting Line rules for Profit Target 2
highColor3 = high > highRes3 ? lime : aqua
lowColor3 = low < lowRes3 ? lime : aqua
//Plots For Profit Targe 2
plot(fr2to17 > 0 ? highRes3 : na, color=highColor3, style=circles, linewidth=6)
plot(fr2to17 > 0 ? lowRes3 : na, color=lowColor3, style=circles, linewidth=6)
//Rules for when to plot Numbers 1 or 2 When Profit Target 1 or 2 is Reached
pt1UHit = (high >= highRes2 and high[1] < highRes2 and high[2] < highRes2 and high[3] < highRes2 and high[4] < highRes2 and high[5] < highRes2) and fr2to17 > 0
pt1LHit = (low <= lowRes2 and low[1] > lowRes2 and low[2] > lowRes2 and low[3] > lowRes2 and low[4] > lowRes2 and low[5] > lowRes2) and low > lowRes3 and fr2to17 > 0
pt2UHit = (high >= highRes3 and high[1] < highRes3 and high[2] < highRes3 and high[3] < highRes3 and high[4] < highRes3 and high[5] < highRes3) and fr2to17 > 0
pt2LHit = (low <= lowRes3 and low[1] > lowRes3 and low[2] > lowRes3 and low[3] > lowRes3 and low[4] > lowRes3 and low[5] > lowRes3) and fr2to17 > 0
//Rules for plotting 1 or 2 When Profit Target 1 or 2 is Reached
plotchar(snp and pt1UHit ? pt1UHit : na, title='UpSide Profit Target 1 Achieved', char='1', location=location.abovebar, color=black, transp=0, offset=0)
plotchar(snp and pt1LHit ? pt1LHit : na, title='DownSide Profit Target 1 Achieved', char='1', location=location.belowbar, color=black, transp=0, offset=0)
plotchar(snp and pt2UHit ? pt2UHit : na, title='UpSide Profit Target 2 Achieved', char='2', location=location.abovebar, color=black, transp=0, offset=0)
plotchar(snp and pt2LHit ? pt2LHit : na, title='DownSide Profit Target 2 Achieved', char='2', location=location.belowbar, color=black, transp=0, offset=0)
// REFERENCES OF USAGE
// Main Trend Indications
// ****The main trend is indicated with green(bull) or red(bears) small "triangles" on the bottom(bull) or the top(bears) of the chart.
// *****To detect the Bull/Bear major trend the script use 256 murrey, if > 0 (green) we are uptrend in other cases we are downtrend
// Pullback detection
// ****The pullbacks are indicated with Green(bull) or red(bears) medium "Arrows"
// *****To detect pullbacks the system compare the long term murrey with the short term murrey, if long term is Green(green triangles)
// *****so we are in a main bull trend, if the short term murrey make an extreme low then the pullback is indicated
// *****The same for the short pullback, if long term murrey is RED and we have an extreme green short term murrey we shot a red arrow
// Extreme Overbught/Oversold
// ****The extreme OO is indicated with fancy diamonds
// *****To detect the Extremes price movements we combine the two murrey, if Long Term Murrey is overbought and short term murrey too
// *****Then the diamond show on the screen obove or below based on the extreme if overbought or oversold
// Resume
// Triangles indicate Major Trend Up/Down
// Arrows Indicate Continuation pullbacks
// Diamonds Indicate Extreme Prices
// Inputs
length1 = input(256, minval = 10, title = "Look back Length 1 (suggested 256)")
length2 = input(24, minval = 10, title = "Look back Length 2 (suggested 32)")
mult = input(0.125, title = "Mutiplier; Only Supports 0.125 = 1/8")
// Donch Channel
hi1 = highest(high, length1)
hi2 = highest(high, length2)
lo1 = lowest(low, length1)
lo2 = lowest(low, length2)
range3 = hi1 - lo1
range4 = hi2 - lo2
multiplier1 = (range3) * mult
multiplier2 = (range4) * mult
midline1 = lo1 + multiplier1 * 4
midline2 = lo2 + multiplier2 * 4
oscillator1 = (close - midline1)/(range3/2)
oscillator2 = (close - midline2)/(range4/2)
//Plot the Main Trend
//trend up 256 murrey math (green)
//plotshape(oscillator1>0?true:na,style=shape.triangleup,location=location.bottom,color=green)
//trend down 256 murrey math (red)
//plotshape(oscillator1<0?true:na,style=shape.triangledown,location=location.top,color=red)
//Pullback detection system (divergence between 256 murrey and 32 murrey)
//bulls pullback detection
//plotshape(oscillator1>0 and oscillator2<-0.75,style=shape.circle, color=green,location=location.belowbar,size=size.large)
//bears pullback detection
//plotshape(oscillator1<0 and oscillator2>0.75,style=shape.circle,color=red,location=location.abovebar,size=size.large)
//DANGERS ALERTS!
//this plots are alerts of hyper extremes prices!
//Hyper bulls indication for imminent reverse to sell
plotshape(oscillator1>0.90 and oscillator2>0.90,style=shape.diamond,color=purple,location=location.abovebar,size=size.large)
//Hyper bears indication for imminent reverse to buy
plotshape(oscillator1<-0.90 and oscillator2<-0.90,style=shape.diamond,color=fuchsia,location=location.belowbar,size=size.large)
//bardzo dobre ATR RENKO emulator ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//ATR Based REnko
atrLen = input(10, minval=1, title="ATR Look Back Length")
isATR = input(true, title="Checked Box = ATR Renkos, If You Un Check Box Please Read Below")
def = input(false, title="Number Below is Multiplied by .001, So 1=10 Pips on EURUSD, 10=100 Pips, 1000 = 1 Point on Stocks/Furures")
tradLen1 = input(1000, minval=0, title="Input for Non-ATR Renkos, See Above for Calculations")
tradLen = tradLen1 * .001
param = isATR ? renko(tickerid, "open", "ATR", atrLen) : renko(tickerid, "open", "Traditional", tradLen)
renko_close = security(param, period, close)
renko_open = security(param, period, open)
col = renko_close < renko_open ? maroon : navy
p11=plot(renko_close, style=cross, linewidth=3, color=col)
p21=plot(renko_open, style=cross, linewidth=3, color=col)
//(p1, p2, color=black, transp=80)
//++++//Bollingers Bands Fibonacci+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
p=close
sma=sma(p,len)
avg=atr(len)
fibratio1=input(defval=1.618,title="Fibonacci Ratio 1")
fibratio2=input(defval=2.618,title="Fibonacci Ratio 2")
fibratio3=input(defval=4.236,title="Fibonacci Ratio 3")
r7=avg*fibratio1
r8=avg*fibratio2
r9=avg*fibratio3
top3=sma+r9
top2=sma+r8
top1=sma+r7
bott1=sma-r7
bott2=sma-r8
bott3=sma-r9
//
t3=plot(top3,transp=0,title="Upper 3",color=navy)
t2=plot(top2,transp=0,title="Upper 2",linewidth=2,color=navy)
//t1=plot(top1,transp=0,title="Upper 1",color=navy)
//b1=plot(bott1,transp=0,title="Lower 1",color=maroon)
b2=plot(bott2,transp=0,title="Lower 2",linewidth=2,color=maroon)
b3=plot(bott3,transp=0,title="Lower 3",color=maroon)
//plot(sma,style=cross,title="SMA",color=black)
//fill(t3,b3,color=navy,transp=85)
//+++//Profit target area+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
bars =input(title="Reversial pattern length (bars)", type=integer, defval=3, minval=1)
exbars = input(title="S/R detection (bars)", type=integer, defval=10, minval=1)
descent_cnt = high <= nz(high[1])?nz(descent_cnt[1])+1:0
ascent_cnt = low >= nz(low[1])?nz(ascent_cnt[1])+1:0
descent = descent_cnt >= bars
ascent = ascent_cnt >= bars
st = ascent?true:(descent?false:nz(st[1]))
h = st[1] and not st?highest(high,exbars):nz(h[1])
l = not st[1] and st?lowest(low,exbars):nz(l[1])
f = h - l
h38 = l + f/(1-0.382)
h62 = l + f/(1-0.618)
l38 = h - f/(1-0.382)
l62 = h - f/(1-0.618)
//modeline = plot(st[0]?l:h,color=white,title="invisible plot", style=cross)
ph = plot(h,color=green, title="resistance")
pl = plot(l,color=red, title="support")
p3 = plot(h38, color=#80FF80, title="38% above")
p1 = plot(h62, color=#C0FFC0, title="62% above")
p2 = plot(l62, color=#FFC0FF, title="62% below")
p4 = plot(l38, color=#FF80FF, title="38% below")
fill(p1,p3,color=#80FF80, transp=50, title="62% above")
fill(p3,ph,color=#00FF00, transp=90, title="38% above")
fill(p2,p4,color=#FF80FF, transp=60, title="62% below")
fill(p4,pl,color=#FF00FF, transp=95, title="38% below")
//fill(ph,modeline,color=green, transp=00, title="going up")
//fill(pl,modeline,color=red, transp=00, title="going down")
//+++//COG"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
src12 = close
length12 = input(34)
median12=0
mult12=input(2.3)
offset = input(21)
tr_custom() =>
x1=high-low
x2=abs(high-close[1])
x3=abs(low-close[1])
max(x1, max(x2,x3))
atr_custom(x,y) =>
sma(x,y)
dev12 = (mult12 * stdev(src12, length12))
basis12=linreg(src12, length12, median12)
ul12 = (basis12 + dev12)
ll12 = (basis12 - dev12)
tr_v = tr_custom()
acustom=(2*atr_custom(tr_v, length12))
uls=basis12+acustom
lls=basis12-acustom
// Plot STDEV channel
//plot(basis, linewidth=1, color=navy, style=line, linewidth=1, title="Median")
lb=plot(ul12, color=red, linewidth=1, title="BB+", style=dashed)
tb=plot(ll12, color=blue, linewidth=1, title="BB-", style=dashed)
//fill(tb,lb, silver, title="Region fill")
// Plot ATR channel
//plot(basis, linewidth=2, color=navy, style=line, linewidth=2, title="Median")
ls=plot(uls, color=red, linewidth=3, title="Starc+", style=circles)
ts=plot(lls, color=blue, linewidth=3, title="Star-", style=circles)
fill(ts,tb,#99CCFF ,transp=50, title="Region fill")
fill(ls,lb, #FFCC99,transp=50, title="Region fill")
// Mark SQZ
plot_offs_high=2
plot_offs_low=2
sqz_f=(uls>ul12) and (lls<ll12)
b_color=sqz_f ? teal : na
plot(sqz_f ? lls-plot_offs_low : na, color=b_color, style=cross, linewidth=2)
plot(sqz_f ? uls+plot_offs_high : na, color=b_color, style=cross, linewidth=2)
//eof