0% found this document useful (0 votes)
97 views2 pages

Alpha Max

This document contains a source code for a trading indicator called 'AlphaTrend' written in Pine Script version 5. It calculates trend signals based on price movements and includes options for displaying buy/sell signals and alert conditions for trading strategies. The code allows customization of parameters such as multiplier and common period for the calculations.

Uploaded by

deep parmar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
97 views2 pages

Alpha Max

This document contains a source code for a trading indicator called 'AlphaTrend' written in Pine Script version 5. It calculates trend signals based on price movements and includes options for displaying buy/sell signals and alert conditions for trading strategies. The code allows customization of parameters such as multiplier and common period for the calculations.

Uploaded by

deep parmar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

// This source code is subject to the terms of the Mozilla Public License 2.

0 at
https://mozilla.org/MPL/2.0/
// author © CryptoWolf,@kivancozbilginc
// developer © CyrptoWolf,,@kivancozbilginc
//@version=5
indicator('AlphaTrend', shorttitle='AMax', overlay=true, format=format.price,
precision=2, timeframe='')
coeff = input.float(1, 'Multiplier', step=0.1)
AP = input(14, 'Common Period')
ATR = ta.sma(ta.tr, AP)
src = input(close)
showsignalsk = input(title='Show Signals?', defval=true)
novolumedata = input(title='Change calculation (no volume data)?', defval=false)
upT = low - ATR * coeff
downT = high + ATR * coeff
AlphaTrend = 0.0
AlphaTrend := (novolumedata ? ta.rsi(src, AP) >= 50 : ta.mfi(hlc3, AP) >= 50) ? upT
< nz(AlphaTrend[1]) ? nz(AlphaTrend[1]) : upT : downT > nz(AlphaTrend[1]) ?
nz(AlphaTrend[1]) : downT

color1 = AlphaTrend > AlphaTrend[2] ? #00E60F : AlphaTrend < AlphaTrend[2] ?


#80000B : AlphaTrend[1] > AlphaTrend[3] ? #00E60F : #80000B
k1 = plot(AlphaTrend, color=color.new(#0022FC, 0), linewidth=3)
k2 = plot(AlphaTrend[2], color=color.new(#FC0400, 0), linewidth=3)

fill(k1, k2, color=color1)

trimaxlength =input(10,'AlphaMaxLength')
trimaxsrc = input(close)
//----
ama = 0.
hh = math.max(math.sign(ta.change(ta.highest(trimaxlength))),0)
ll = math.max(math.sign(ta.change(ta.lowest(trimaxlength))*-1),0)
tc = math.pow(ta.sma(hh or ll ? 1 : 0,trimaxlength),2)
ama := nz(ama[1]+tc*(trimaxsrc-ama[1]),src)
plot(ama,"Plot",#ff1100,2)

buyAlphaSignalk = ta.crossover(AlphaTrend, AlphaTrend[2])


sellAlphaSignalk = ta.crossunder(AlphaTrend, AlphaTrend[2])

buySignalk = (ta.crossover(ama, AlphaTrend[2]) and ama > ama[1]) or


buyAlphaSignalk
sellSignalk = (ta.crossunder(ama, AlphaTrend[2]) and ama < ama[1]) or
sellAlphaSignalk

K1 = ta.barssince(buySignalk)
K2 = ta.barssince(sellSignalk)
O1 = ta.barssince(buySignalk[1])
O2 = ta.barssince(sellSignalk[1])

plotshape(buySignalk and showsignalsk and O1 > K2 ? AlphaTrend[2] * 0.9999 : na,


title='BUY', text='BUY', location=location.absolute, style=shape.labelup,
size=size.tiny, color=color.new(#0022FC, 0), textcolor=color.new(color.white, 0))

plotshape(sellSignalk and showsignalsk and O2 > K1 ? AlphaTrend[2] * 1.0001 : na,


title='SELL', text='SELL', location=location.absolute, style=shape.labeldown,
size=size.tiny, color=color.new(color.maroon, 0), textcolor=color.new(color.white,
0))
alertcondition(buySignalk and O1 > K2, title='Potential BUY Alarm', message='BUY
SIGNAL!')
alertcondition(sellSignalk and O2 > K1, title='Potential SELL Alarm', message='SELL
SIGNAL!')

alertcondition(buySignalk[1] and O1[1] > K2, title='Confirmed BUY Alarm',


message='BUY SIGNAL APPROVED!')
alertcondition(sellSignalk[1] and O2[1] > K1, title='Confirmed SELL Alarm',
message='SELL SIGNAL APPROVED!')

alertcondition(ta.cross(close, AlphaTrend), title='Price Cross Alert',


message='Price - AlphaTrend Crossing!')
alertcondition(ta.crossover(low, AlphaTrend), title='Candle CrossOver Alarm',
message='LAST BAR is ABOVE ALPHATREND')
alertcondition(ta.crossunder(high, AlphaTrend), title='Candle CrossUnder Alarm',
message='LAST BAR is BELOW ALPHATREND!')

alertcondition(ta.cross(close[1], AlphaTrend[1]), title='Price Cross Alert After


Bar Close', message='Price - AlphaTrend Crossing!')
alertcondition(ta.crossover(low[1], AlphaTrend[1]), title='Candle CrossOver Alarm
After Bar Close', message='LAST BAR is ABOVE ALPHATREND!')
alertcondition(ta.crossunder(high[1], AlphaTrend[1]), title='Candle CrossUnder
Alarm After Bar Close', message='LAST BAR is BELOW ALPHATREND!')

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy