TradingView To MT4 Port Request: "GreedZone" and "FearZone" by Zeiierman
mrtools, kvak, or any of the expert programmers on this website, I have a new indicator porting request. Actually, I'm wondering if two very simple indicators with easy-to-follow code can be fused into one.
Below is
GreedZone by Zeiierman, which helps identify reversal points for early sell trades .
Code: Select all
// This work is licensed under a Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0) https://creativecommons.org/licenses/by-nc-sa/4.0/
// © Zeiierman
//Copyright by Zeiierman.
//The information contained in my scripts/indicators/ideas does not constitute financial advice or a solicitation to buy or sell any securities of any type.
//I will not accept liability for any loss or damage, including without limitation any loss of profit, which may arise directly or indirectly from use of or reliance on such information.
//All investments involve risk, and the past performance of a security, industry, sector, market, financial product, trading strategy, or individual’s trading does not guarantee future results or returns.
//Investors are fully responsible for any investment decisions they make. Such decisions should be based solely on an evaluation of their financial circumstances, investment objectives, risk tolerance, and liquidity needs.
//My scripts/indicators/ideas are only for educational purposes!
//@version=4
study("GreedZone indicator ", overlay=true, shorttitle="GreedZone (Expo)")
source = input(ohlc4, title="Source", group="Source")
Low_period = input(30, title="Low Period", group="GreedZone Settings")
Stdev_period = input(50, title="Stdev Period", group="GreedZone Settings")
WMA = input(false, title="Use WMA instead of SMA?", group="Average Type")
// Condition One
FZ1 = (lowest(source,Low_period) - source)/lowest(source,Low_period)
AVG1 = sma(FZ1,Stdev_period)
if WMA
AVG1 := wma(FZ1,Stdev_period)
STDEV1 = stdev(FZ1,Stdev_period)
FZ1Limit = AVG1-STDEV1
// Condition Two
FZ2 = sma(source, Low_period)
AVG2 = sma(FZ2, Stdev_period)
if WMA
FZ2 := wma(source, Low_period)
AVG2 := wma(FZ2, Stdev_period)
STDEV2 = stdev(FZ2, Stdev_period)
FZ2Limit = AVG2+STDEV2
// GreedZone
Greedzone_Con = FZ1 < FZ1Limit and FZ2 > FZ2Limit
GreedZoneOpen = Greedzone_Con? low+tr:na
GreedZoneClose = Greedzone_Con? low+2*tr:na
plotcandle(GreedZoneOpen,GreedZoneOpen,GreedZoneClose,GreedZoneClose, color=#90EE90, bordercolor=color.green, title="GreedZone Candlesticks")
// Alerts
AlertCircle = input(true, title="Show Alert Circle?", group="Alerts")
Alert_Col = Greedzone_Con != Greedzone_Con[1] and AlertCircle? #90EE90 : na
plotshape(Greedzone_Con, style=shape.circle, location=location.abovebar, size=size.tiny, color=Alert_Col, title="Alert Circle")
alertcondition(Greedzone_Con != Greedzone_Con[1], title='GreedZone', message='GreedZone')
And below is
FearZone by Zeiierman, which helps identify reversal points for early buy trades.
Code: Select all
// This work is licensed under a Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0) https://creativecommons.org/licenses/by-nc-sa/4.0/
// © Zeiierman
//Copyright by Zeiierman.
//The information contained in my scripts/indicators/ideas does not constitute financial advice or a solicitation to buy or sell any securities of any type.
//I will not accept liability for any loss or damage, including without limitation any loss of profit, which may arise directly or indirectly from use of or reliance on such information.
//All investments involve risk, and the past performance of a security, industry, sector, market, financial product, trading strategy, or individual’s trading does not guarantee future results or returns.
//Investors are fully responsible for any investment decisions they make. Such decisions should be based solely on an evaluation of their financial circumstances, investment objectives, risk tolerance, and liquidity needs.
//My scripts/indicators/ideas are only for educational purposes!
//@version=4
study("Fearzone (Expo) - Contrarian Indicator", overlay=true, shorttitle="FearZone (Expo)")
source = input(ohlc4, title="Source", group="Source")
High_period = input(30, title="High Period", group="Fearzone Settings")
Stdev_period = input(50, title="Stdev Period", group="Fearzone Settings")
WMA = input(true, title="Use WMA instead of SMA?", group="Average Type")
// Condition One
FZ1 = (highest(source,High_period) - source)/highest(source,High_period)
AVG1 = sma(FZ1,Stdev_period)
if WMA
AVG1 := wma(FZ1,Stdev_period)
STDEV1 = stdev(FZ1,Stdev_period)
FZ1Limit = AVG1+STDEV1
// Condition Two
FZ2 = sma(source, High_period)
AVG2 = sma(FZ2, Stdev_period)
if WMA
FZ2 := wma(source, High_period)
AVG2 := wma(FZ2, Stdev_period)
STDEV2 = stdev(FZ2, Stdev_period)
FZ2Limit = AVG2-STDEV2
// FearZone
Fearzone_Con = FZ1 > FZ1Limit and FZ2 < FZ2Limit
FearZoneOpen = Fearzone_Con? low-tr :na
FearZoneClose = Fearzone_Con? low-2*tr :na
plotcandle(FearZoneOpen,FearZoneOpen,FearZoneClose,FearZoneClose, color=#FC6C85, bordercolor=color.red, title="FearZone Candlesticks")
// Alerts
AlertCircle = input(true, title="Show Alert Circle?", group="Alerts")
Alert_Col = Fearzone_Con != Fearzone_Con[1] and AlertCircle? #FC6C85 : na
plotshape(Fearzone_Con, style=shape.circle, location=location.belowbar, size=size.tiny, color=Alert_Col, title="Alert Circles")
alertcondition(Fearzone_Con != Fearzone_Con[1], title='FearZone', message='FearZone')
Is it possible to convert either of these indicators to MT4 or even MT5? And if so, I think these two indicators would be most useful if they could be fused into one indicator so it can be used as a potentially powerful way to identify reversals in a real-time, non-repainting way.
Thank you guys (and girls) for all your hard work as always!