Strategy Yolerap

If you need an Indicator or Signal developed or translated from other language, please post all Indicator development REQUESTS to this section here.

Moderator: admin

Strategy Yolerap

Postby yolerap » Wed May 06, 2020 3:12 pm

Hi Apprentice and team,

Could you please translate this strategy from TradingView to LUA indicator please ?


strategy("P&F scalp strat V3", shorttitle="MEXlongOnly_strat V3", overlay=true)
timeframe = input('3')
box = input('Traditional')
boxsize = input(5, type=float)
reversal = input(1)

pnf = pointfigure(tickerid, 'close', box, boxsize, reversal)

pnf_open= security(pnf, timeframe , open)
pnf_close= security(pnf, timeframe , close)

p1 = plot(pnf_open, title="pnf_open", color=green)
p2 = plot(pnf_close, title="pnf_close",color=maroon)

base = pnf_close> pnf_open? pnf_close: pnf_open
p0 = plot(base, title="base", color=gray)

fill(p0, p2, color=green, transp=70)
fill(p0, p1, color=maroon, transp=70)

entry() => (base > pnf_close)
exit() => (base > pnf_open)

alertcondition(entry(), title='buy', message='buy!')
alertcondition(exit(), title='sell', message='sell!')

strategy.risk.allow_entry_in(strategy.direction.long)
strategy.entry("Long", long=true, when=entry())
strategy.entry("close", false, when=exit())


Thank you in advance,
Yolerap
yolerap
FXCodeBase: Initiate
 
Posts: 103
Joined: Sat Aug 17, 2019 9:44 pm

Return to Indicator and Signal Requests

Who is online

Users browsing this forum: No registered users and 26 guests