Attachments forums

List of attachments posted on this forum.


All files on forums: 136892

Re: Already Converted TradingView Indicators to MT4 Indicators

louisforex, Thu Mar 30, 2023 1:53 am

Of all the indicators I've tested on tradingview. This is my favorite because even if its wrong in identifying the trend. It will take you out with a very small loss or even a gain. It also is great for a filter or confirmation paired with other indicators. Attached is a couple of pictures with the name and what it looks like on the chart. Ill also include the source code. I got a strategy coded and the results very promising but it was coded in the pinescript version 2 and when I try to convert it to the latest version of tradingview code language I ran into issues. I was hoping that one the great coders here can help me convert this into a metatrader 4 indicator. The indicator code has a youtube link in it that describes one of the strategies used with the indicator but Im sure it can be coded without that link to youtube.



//@version=2
study("TrendAlert", overlay=false)

// Trend and direction determination Step 1 en Step 2 method conform ZoneRecovery from 4x-dat.com Joseph Nemeth
//
// step 1 LongTerm timefram/resolution (LT) determine general direction
//• color last Heikenahsi bar gives is the general direction
// step 2 MidTerm timeframe/resolution determine trend
//• color last Heikenahsi bar must match Direction step 1 and
//• slope of 20EMA in direction step 1 and
//• price relation to EMA20: above = up, below=down
// Step 1 AND step 2 => TrendAlert (-1 for Short, 1 for Long, 0 for No trend)

//Heiken Ashi Candles
data = heikenashi(tickerid)
resLT = input(title="Res LT", type=resolution, defval="D")
resMT = input(title="Res MT", type=resolution, defval="240")


LTo = security(data, resLT, open)
LTc = security(data, resLT, close)
MTo = security(data, resMT, open)
MTc = security(data, resMT, close)

LTlong = LTc > LTo
LTshort = LTc < LTo
MTema20 = ema(MTc,20)
MTema20delta= change(MTema20)

MTlong = MTc > MTo and MTc > MTema20 and MTema20delta > 0
MTshort = MTc < MTo and MTc < MTema20 and MTema20delta < 0



Long = MTlong and LTlong
Short = MTshort and LTshort

plot(Long ? 1 : Short ? -1: 0, title="TrendAlert", color= Long ? lime : Short ? red : gray, style=columns )
All files in topic