Convert tradingview script into python indicator

已关闭 已发布的 5 年前 货到付款
已关闭 货到付款

I need to convert a tradingview script into python ! To use it as indicator and backtests on Price chart.

Here IS the script:

//@version=3

strategy("Pivot Reversal Strategy", overlay=true)

// === BACKTEST RANGE ===

FromMonth = input(defval = 2, title = "From Month", minval = 1)

FromDay = input(defval = 1, title = "From Day", minval = 1)

FromYear = input(defval = 2018, title = "From Year", minval = 2014)

ToMonth = input(defval = 1, title = "To Month", minval = 1)

ToDay = input(defval = 1, title = "To Day", minval = 1)

ToYear = input(defval = 9999, title = "To Year", minval = 2014)

leftBars = input(4)

rightBars = input(2)

swh = pivothigh(leftBars, rightBars)

swl = pivotlow(leftBars, rightBars)

swh_cond = not na(swh)

hprice = 0.0

hprice := swh_cond ? swh : hprice[1]

le = false

le := swh_cond ? true : (le[1] and high > hprice ? false : le[1])

if (le)

[login to view URL]("PivRevLE", [login to view URL], comment="PivRevLE", stop=hprice + [login to view URL], when= (time > timestamp(FromYear, FromMonth, FromDay, 00, 00)) and (time < timestamp(ToYear, ToMonth, ToDay, 23, 59)))

swl_cond = not na(swl)

lprice = 0.0

lprice := swl_cond ? swl : lprice[1]

se = false

se := swl_cond ? true : (se[1] and low < lprice ? false : se[1])

if (se)

[login to view URL]("PivRevSE", [login to view URL], comment="PivRevSE", stop=lprice - [login to view URL], when= (time > timestamp(FromYear, FromMonth, FromDay, 00, 00)) and (time < timestamp(ToYear, ToMonth, ToDay, 23, 59)))

//plot([login to view URL], title="equity", color=red, linewidth=2, style=areabr)

Python 软件构架 网页搜罗

项目ID: #18131315

关于项目

3个方案 远程项目 活跃的5 年前

有3名威客正在参与此工作的竞标,均价€41/小时

adeelpirzada

Hi, there i have done scrapping almost on Half of Worldwide web including eCommerce giants(Amazon,eBay,craigslist) News Feed, Social media websites, API's. I develop my own tools based on client requirements with Multi 更多

€55EUR 在1天里
(24条评论)
5.8
mikeitexpert

Dear Employer, I have extensive experience in developing Python scripts for variety of applications ranging from trading algorithms, machine learning, data mining, web application, mobile application development etc. 更多

€24 EUR 在3天内
(35条评论)
4.9
alexey105

I found your job posting and I think I'd be a great fit. I am a full stack developer with extensive experience in Python, Pandas, PySpark, Enterprise Java, and JavaScript. I'm confident in your plan! I'm working in 更多

€44EUR 在1天里
(0条评论)
0.0