Tradingview transcode ctrader for help

Created at 14 Dec 2019, 13:12
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
RO

ropo

Joined 14.12.2019

Tradingview transcode ctrader for help
14 Dec 2019, 13:12


So to provide some context, I'm not a developer/coder by any stretch of the imagination.

The following is the code written by tradingview. Although the rules are simple, I find that ctrader code is more complex. I have tried many times and failed to convert it. I hope that the caring coder can help to convert it into ctrader code. Thank you.

 

///////////////////////////////////////////////////////////

//@version=4
strategy("BBD", overlay=true)
source = close
length = input(20, minval=1)
mult = input(2.0, minval=0.01, maxval=5)

basis = ema(source, length)
dev = mult * stdev(source, length)

upper = basis + dev
lower = basis - dev

plot(basis, color=#FF595959, linewidth=2)
p1 = plot(upper, color=#FF595959, linewidth=2)
p2 = plot(lower, color=#FF595959, linewidth=2)
fill(p1, p2)

if (crossover(source, lower))
    strategy.entry("Buy", strategy.long, stop=lower, oca_name="BBD", oca_type=strategy.oca.cancel, comment="Buy")
else
    strategy.cancel(id="Buy")

if (crossunder(source, upper))
    strategy.entry("Sell", strategy.short, stop=upper, oca_name="BBD", oca_type=strategy.oca.cancel, comment="Sell")
else
    strategy.cancel(id="Sell")


///////////////////////////////////////////////////////////


@ropo
Replies

PanagiotisCharalampous
16 Dec 2019, 08:38

Hi Tommy2019,

You can also consider posting a Job or ask the help of a professional.

Best Regards,

Panagiotis


@PanagiotisCharalampous