TradingView
SeaSide420
11 sept. 2017 04:04

EURNZDbot 

Euro Fx/New Zealand DollarFXCM

Description

This Strategy watches 3 pairs at once.
EUR/USD NZD/USD EUR/NZD
it trades on EUR/NZD based on HULL_MA movements of all 3.
It also uses SAR and DT on the EUR/NZD chart.
Taken from the MT4 robot EURNZDbot
Commentaires
Arpi2018
Giving error after pasting in pine editor and saving :
line 51: mismatched input 'strategy.close' expecting 'end of line without continuation'
SeaSide420
@Arpi2018, i.gyazo.com/105dc1d88e199b9fa13913d646143fe5.png
maybe need the spaces before the words start? on line 51
Arpi2018
@SeaSide420, Hmm, error has gone . But after applying to chart, i do not see any long or short signal on 15 mins chart. What may be problem ?
Arpi2018
@SeaSide420, Can you look in this problem: after applying to chart, i do not see any long or short signal on 15 mins chart. What may be problem ?
SeaSide420
@Arpi2018, supposed to use newer indicator. eurnzd bot is old and unsupported. i would delete it if i could
pollon68
operation add to chart failed, reason: line 51: mismatched imput 'strategy.close' expecting 'end of line without line continuation'
SeaSide420
//@version=2
// for EURNZD
strategy("EURNZDbot", shorttitle="ENbot", overlay=true, default_qty_type=strategy.percent_of_equity, max_bars_back=720, default_qty_value=100, calc_on_order_fills= true, calc_on_every_tick=true, pyramiding=0)
keh=input(title="Double HullMA",type=integer,defval=3, minval=1)
dt = input(defval=0.0010, title="Decision Threshold (0.001)", type=float, step=0.0001)
SL = input(defval=-2100.00, title="Stop Loss in $", type=float, step=1)
TP = input(defval=4200.00, title="Target Point in $", type=float, step=1)
ot=1
src = ohlc4
EU=(security("EURUSD", '15', src))
e2ma=2*wma(EU,round(keh/2))
ema=wma(EU,keh)
ediff=e2ma-ema
esqn=round(sqrt(keh))
e2ma1=2*wma(EU[1],round(keh/2))
ema1=wma(EU[1],keh)
ediff1=e2ma1-ema1
esqn1=round(sqrt(keh))
e1=wma(ediff,esqn)
e2=wma(ediff1,esqn)
NZ=(security("NZDUSD", '15', src))
n2ma=2*wma(NZ,round(keh/2))
nma=wma(NZ,keh)
ndiff=n2ma-nma
nsqn=round(sqrt(keh))
n2ma1=2*wma(NZ[1],round(keh/2))
nma1=wma(NZ[1],keh)
ndiff1=n2ma1-nma1
nsqn1=round(sqrt(keh))
n1=wma(ndiff,nsqn)
n2=wma(ndiff1,nsqn)
CUR=(security("EURNZD", '15', src))
s2ma=2*wma(CUR,round(keh/2))
sma=wma(CUR,keh)
sdiff=s2ma-sma
ssqn=round(sqrt(keh))
s2ma1=2*wma(CUR[1],round(keh/2))
sma1=wma(CUR[1],keh)
sdiff1=s2ma1-sma1
ssqn1=round(sqrt(keh))
s1=wma(sdiff,ssqn)
s2=wma(sdiff1,ssqn)
confidence=(security(tickerid, 'D', src)-security(tickerid, 'D', src[1]))/security(tickerid, 'D', src[1])
// b=s1>s2?lime:black
// c=s1>s2?black:red
// c1=plot(s1, color=b, title="hull1", linewidth=2, transp=0)
// c2=plot(s2, color=c, title="hull1", linewidth=2, transp=0)
// fill(c1, c2, color=c, transp=75)
closelong = e1<e2 and n1>n2 and s1<s2 and confidence<dt or strategy.openprofit<SL or strategy.openprofit>TP
if (closelong)
strategy.close("Long")
closeshort = e1>e2 and n1<n2 and s1>s2 and confidence>dt or strategy.openprofit<SL or strategy.openprofit>TP
if (closeshort)
strategy.close("Short")
longCondition = e1>e2 and n1<n2 and s1>s2 and strategy.opentrades<ot and confidence>dt
if (longCondition)
strategy.entry("Long",strategy.long)
shortCondition = e1<e2 and n1>n2 and s1<s2 and strategy.opentrades<ot and confidence<dt
if (shortCondition)
strategy.entry("Short",strategy.short)
SeaSide420
THIS IS OLD, if you look at my published scripts: tradingview.com/u/SeaSide420/ is all of them and where new ones will appear
Cervinmole
Hello, and thank you for all the scripts sharing. I will have a question: what are the reasons that made you choose these 2 currency pairs precisely, to trade the EURNZD? And subsidiary question: to trade the GBPUSD, what are the other 2 pairs you would choose?
SeaSide420
@Cervinmole, hi, your welcome. i was just experimenting, and that script is quite old. i think if i remember right the backtest isnt accurate. i recommend try it on other any pairs/trading instrument. But, yea its old. needs updating.
i will try to publish something new soon
Plus